aboutsummaryrefslogtreecommitdiff
path: root/qapi/qmp-registry.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-05-08 14:24:44 -0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-05-15 09:15:16 -0500
commitd34b867d816585900b72d09d42a34cea3057903d (patch)
tree2aa501d2c933659db2597959c1349be2268a86b0 /qapi/qmp-registry.c
parent76ee152a86d5f2533443ce4d2be6fe253cfb3c45 (diff)
downloadqemu-d34b867d816585900b72d09d42a34cea3057903d.zip
qemu-d34b867d816585900b72d09d42a34cea3057903d.tar.gz
qemu-d34b867d816585900b72d09d42a34cea3057903d.tar.bz2
qapi: add support for command options
Options allow for changes in commands behavior. This commit introduces the QCO_NO_SUCCESS_RESP option, which causes a command to not emit a success response. This is needed by commands such as qemu-ga's guest-shutdown, which may not be able to complete before the VM vanishes. In this case, it's useful and simpler not to bother sending a success response. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qapi/qmp-registry.c')
-rw-r--r--qapi/qmp-registry.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c
index 43d5cde..5414613 100644
--- a/qapi/qmp-registry.c
+++ b/qapi/qmp-registry.c
@@ -17,7 +17,8 @@
static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
QTAILQ_HEAD_INITIALIZER(qmp_commands);
-void qmp_register_command(const char *name, QmpCommandFunc *fn)
+void qmp_register_command(const char *name, QmpCommandFunc *fn,
+ QmpCommandOptions options)
{
QmpCommand *cmd = g_malloc0(sizeof(*cmd));
@@ -25,6 +26,7 @@ void qmp_register_command(const char *name, QmpCommandFunc *fn)
cmd->type = QCT_NORMAL;
cmd->fn = fn;
cmd->enabled = true;
+ cmd->options = options;
QTAILQ_INSERT_TAIL(&qmp_commands, cmd, node);
}