Permalink
Browse files

qapi: Convert stop

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
  • Loading branch information...
1 parent 7a7f325 commit 5f158f21f9b2ff129b5154bccf6212692ac9f6c1 Luiz Capitulino committed Sep 15, 2011
Showing with 25 additions and 15 deletions.
  1. +1 −2 hmp-commands.hx
  2. +5 −0 hmp.c
  3. +1 −0 hmp.h
  4. +0 −9 monitor.c
  5. +12 −0 qapi-schema.json
  6. +1 −4 qmp-commands.hx
  7. +5 −0 qmp.c
View
@@ -290,8 +290,7 @@ ETEXI
.args_type = "",
.params = "",
.help = "stop emulation",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_stop,
+ .mhandler.cmd = hmp_stop,
},
STEXI
View
@@ -99,3 +99,8 @@ void hmp_quit(Monitor *mon, const QDict *qdict)
monitor_suspend(mon);
qmp_quit(NULL);
}
+
+void hmp_stop(Monitor *mon, const QDict *qdict)
+{
+ qmp_stop(NULL);
+}
View
@@ -24,5 +24,6 @@ void hmp_info_status(Monitor *mon);
void hmp_info_uuid(Monitor *mon);
void hmp_info_chardev(Monitor *mon);
void hmp_quit(Monitor *mon, const QDict *qdict);
+void hmp_stop(Monitor *mon, const QDict *qdict);
#endif
View
@@ -1212,15 +1212,6 @@ static void do_singlestep(Monitor *mon, const QDict *qdict)
}
}
-/**
- * do_stop(): Stop VM execution
- */
-static int do_stop(Monitor *mon, const QDict *qdict, QObject **ret_data)
-{
- vm_stop(RUN_STATE_PAUSED);
- return 0;
-}
-
static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs);
struct bdrv_iterate_context {
View
@@ -236,3 +236,15 @@
# Since: 0.14.0
##
{ 'command': 'quit' }
+
+##
+# @stop:
+#
+# Stop all guest VCPU execution.
+#
+# Since: 0.14.0
+#
+# Notes: This function will succeed even if the guest is already in the stopped
+# state
+##
+{ 'command': 'stop' }
View
@@ -178,10 +178,7 @@ EQMP
{
.name = "stop",
.args_type = "",
- .params = "",
- .help = "stop emulation",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_stop,
+ .mhandler.cmd_new = qmp_marshal_input_stop,
},
SQMP
View
@@ -76,3 +76,8 @@ void qmp_quit(Error **err)
qemu_system_shutdown_request();
}
+void qmp_stop(Error **errp)
+{
+ vm_stop(RUN_STATE_PAUSED);
+}
+

0 comments on commit 5f158f2

Please sign in to comment.