aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-09-15 14:34:39 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-04 11:02:57 -0300
commit5f158f21f9b2ff129b5154bccf6212692ac9f6c1 (patch)
tree47e34188e4171242f47ec2f0e950e22ef290a184
parent7a7f325e053c5079ce4b7b8e9e2b0f4c4c30ade8 (diff)
downloadqemu-5f158f21f9b2ff129b5154bccf6212692ac9f6c1.zip
qemu-5f158f21f9b2ff129b5154bccf6212692ac9f6c1.tar.gz
qemu-5f158f21f9b2ff129b5154bccf6212692ac9f6c1.tar.bz2
qapi: Convert stop
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--hmp-commands.hx3
-rw-r--r--hmp.c5
-rw-r--r--hmp.h1
-rw-r--r--monitor.c9
-rw-r--r--qapi-schema.json12
-rw-r--r--qmp-commands.hx5
-rw-r--r--qmp.c5
7 files changed, 25 insertions, 15 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 2163e6f..3ad1ce7 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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 7695dfc..efcb744 100644
--- 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 a3dfafd..cb21cce 100644
--- 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
diff --git a/monitor.c b/monitor.c
index 6e13ef6..2a5230c 100644
--- 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 {
diff --git a/qapi-schema.json b/qapi-schema.json
index 3810463..cd05034 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -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' }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 151a5fa..2ccddee 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -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 1d380b6..6c46479 100644
--- 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);
+}
+