From de253f14912e88f45dbe66984440d27221a75a60 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 27 Jul 2012 16:18:16 -0300 Subject: qmp: switch to the new error format on the wire IMPORTANT: this BREAKS QMP's compatibility for the error response. This commit changes QMP's wire protocol to make use of the simpler error format introduced by previous commits. There are two important (and mostly incompatible) changes: 1. Almost all error classes have been replaced by GenericError. The only classes that are still supported for compatibility with libvirt are: CommandNotFound, DeviceNotActive, KVMMissingCap, DeviceNotFound and MigrationExpected 2. The 'data' field of the error dictionary is gone As an example, an error response like: { "error": { "class": "DeviceNotRemovable", "data": { "device": "virtio0" }, "desc": "Device 'virtio0' is not removable" } } Will now be emitted as: { "error": { "class": "GenericError", "desc": "Device 'virtio0' is not removable" } } Signed-off-by: Luiz Capitulino Reviewed-by: Markus Armbruster --- qmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index ac466382c0..e07c7b0a9d 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -435,8 +435,8 @@ Example: -> { "execute": "inject-nmi" } <- { "return": {} } -Note: inject-nmi is only supported for x86 guest currently, it will - returns "Unsupported" error for non-x86 guest. +Note: inject-nmi fails when the guest doesn't support injecting. + Currently, only x86 guests do. EQMP -- cgit v1.2.3 From 1daa31b9dbec60a7a06690749d73ddeeb35f506d Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 10 Aug 2012 11:04:09 -0500 Subject: qmp: introduce device-list-properties command This can be used in conjunction with qom-list-types to determine the supported set of devices and their parameters. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- qmp-commands.hx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index e07c7b0a9d..e9e0410384 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -2217,3 +2217,10 @@ EQMP .args_type = "implements:s?,abstract:b?", .mhandler.cmd_new = qmp_marshal_input_qom_list_types, }, + + { + .name = "device-list-properties", + .args_type = "typename:s", + .mhandler.cmd_new = qmp_marshal_input_device_list_properties, + }, + -- cgit v1.2.3 From 01d3c80d6876c7de6b07bee92b1b2440b48e60c9 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 10 Aug 2012 11:04:11 -0500 Subject: qapi: add query-machines command This provides the same output as -M ? but in a structured way. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- qmp-commands.hx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index e9e0410384..fd87775461 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -2224,3 +2224,9 @@ EQMP .mhandler.cmd_new = qmp_marshal_input_device_list_properties, }, + { + .name = "query-machines", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_machines, + }, + -- cgit v1.2.3 From e4e31c6324af480a22bf4150266b278368eaa336 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 10 Aug 2012 11:04:13 -0500 Subject: qapi: add query-cpu-definitions command (v2) This command attempts to map to the behavior of -cpu ?. Unfortunately, the output of this command differs wildly across targets. To accommodate this, we use a weak symbol to implement a default version of the command that fails with a QERR_NOT_SUPPORTED error code. Targets can then override and implement this command if it makes sense for them. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- qmp-commands.hx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qmp-commands.hx') diff --git a/qmp-commands.hx b/qmp-commands.hx index fd87775461..521da1055f 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -2230,3 +2230,9 @@ EQMP .mhandler.cmd_new = qmp_marshal_input_query_machines, }, + { + .name = "query-cpu-definitions", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions, + }, + -- cgit v1.2.3