]> git.proxmox.com Git - qemu.git/commitdiff
qapi: Convert stop
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 15 Sep 2011 17:34:39 +0000 (14:34 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Tue, 4 Oct 2011 14:02:57 +0000 (11:02 -0300)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
hmp-commands.hx
hmp.c
hmp.h
monitor.c
qapi-schema.json
qmp-commands.hx
qmp.c

index 2163e6f5f4ffd38120ccdbdd0864eec40f8b1e90..3ad1ce7df9d2772e8f436113b266bfab23a0b04e 100644 (file)
@@ -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
diff --git a/hmp.c b/hmp.c
index 7695dfc4673112519499ffd0d885a3d99bb4f505..efcb74456210d8920c2d6efca0824e1baeb854d1 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -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);
+}
diff --git a/hmp.h b/hmp.h
index a3dfafd8e978c93e31c57083a14467ef9cf9cc2e..cb21ccea94ecb40df487805df7ba0866a58bc206 100644 (file)
--- a/hmp.h
+++ b/hmp.h
@@ -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
index 6e13ef6571687c3a30e00e082205a4c038ef582c..2a5230caa51aa289e94bb05b2abefec91f213996 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -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 {
index 38104635c027ec32c619175e657e73bcd1d243bb..cd05034953b2241a762b7ff652c24dc986069019 100644 (file)
 # 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' }
index 151a5fa651e7e58be5fbb41d9bd7192bb1923961..2ccddeed2ad541a65910063e0f876e4db2aead00 100644 (file)
@@ -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
diff --git a/qmp.c b/qmp.c
index 1d380b6a5f598de611e239565c691c5e4e3fc7b4..6c464792ece127ff5c040b2326a439ed190e6b0b 100644 (file)
--- a/qmp.c
+++ b/qmp.c
@@ -76,3 +76,8 @@ void qmp_quit(Error **err)
     qemu_system_shutdown_request();
 }
 
+void qmp_stop(Error **errp)
+{
+    vm_stop(RUN_STATE_PAUSED);
+}
+