target/loongarch: Fix query-cpu-model-expansion to reject propspull-error-2024-03-12
commit28054406715a90e3fab96d4a29190e8857e57fbc
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 Mar 2024 14:59:18 +0000 (5 15:59 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 12 Mar 2024 13:03:37 +0000 (12 14:03 +0100)
tree5e905d389420c56ce857206aff2a290fa49b0d15
parent8934643a0e2631d468940b05ae2332f219631d17
target/loongarch: Fix query-cpu-model-expansion to reject props

query-cpu-model-expansion takes a CpuModelInfo argument.  The
loongarch version of the command silently ignores the argument's
member @props.  For instance,

    {"execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "la464", "props": null}}}

and

    {"execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "la464", "props": {"prop": null}}}}

succeed.

Add skeleton code for property processing that recognizes no
properties.  Now the two commands fail as they should:

    {"error": {"class": "GenericError", "desc": "Invalid parameter type for 'model.props', expected: object"}}

and

    {"error": {"class": "GenericError", "desc": "Parameter 'model.props.prop' is unexpected"}}

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240305145919.2186971-5-armbru@redhat.com>
[Drop #include now superfluous]
target/loongarch/loongarch-qmp-cmds.c