[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/21] qapi: Convert quit
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 18/21] qapi: Convert quit |
Date: |
Wed, 28 Sep 2011 11:44:42 -0300 |
The original conversion was done by Anthony Liguori. This commit
is just a rebase.
Signed-off-by: Luiz Capitulino <address@hidden>
---
hmp-commands.hx | 2 +-
hmp.c | 6 ++++++
hmp.h | 1 +
monitor.c | 12 ------------
qapi-schema.json | 11 +++++++++++
qmp-commands.hx | 5 +----
qmp.c | 6 ++++++
7 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 9e1cca8..2163e6f 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -43,7 +43,7 @@ ETEXI
.params = "",
.help = "quit the emulator",
.user_print = monitor_user_noop,
- .mhandler.cmd_new = do_quit,
+ .mhandler.cmd = hmp_quit,
},
STEXI
diff --git a/hmp.c b/hmp.c
index 91de86c..1f7000a 100644
--- a/hmp.c
+++ b/hmp.c
@@ -93,3 +93,9 @@ void hmp_info_chardev(Monitor *mon)
qapi_free_ChardevInfoList(char_info);
}
+
+void hmp_quit(Monitor *mon, const QDict *qdict)
+{
+ monitor_suspend(mon);
+ qmp_quit(NULL);
+}
diff --git a/hmp.h b/hmp.h
index 7388f9a..a3dfafd 100644
--- a/hmp.h
+++ b/hmp.h
@@ -23,5 +23,6 @@ void hmp_info_kvm(Monitor *mon);
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);
#endif
diff --git a/monitor.c b/monitor.c
index d546bad..42c754a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -945,18 +945,6 @@ static void do_trace_print_events(Monitor *mon)
trace_print_events((FILE *)mon, &monitor_fprintf);
}
-/**
- * do_quit(): Quit QEMU execution
- */
-static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)
-{
- monitor_suspend(mon);
- no_shutdown = 0;
- qemu_system_shutdown_request();
-
- return 0;
-}
-
#ifdef CONFIG_VNC
static int change_vnc_password(const char *password)
{
diff --git a/qapi-schema.json b/qapi-schema.json
index b26dd25..d6a60d2 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -225,3 +225,14 @@
##
{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
+##
+# @quit:
+#
+# This command will cause the QEMU process to exit gracefully. While every
+# attempt is made to send the QMP response before terminating, this is not
+# guaranteed. When using this interface, a premature EOF would not be
+# unexpected.
+#
+# Since: 0.14.0
+##
+{ 'command': 'quit' }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 0fda5c3..151a5fa 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -63,10 +63,7 @@ EQMP
{
.name = "quit",
.args_type = "",
- .params = "",
- .help = "quit the emulator",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_quit,
+ .mhandler.cmd_new = qmp_marshal_input_quit,
},
SQMP
diff --git a/qmp.c b/qmp.c
index 58337c7..1d380b6 100644
--- a/qmp.c
+++ b/qmp.c
@@ -70,3 +70,9 @@ UuidInfo *qmp_query_uuid(Error **errp)
return info;
}
+void qmp_quit(Error **err)
+{
+ no_shutdown = 0;
+ qemu_system_shutdown_request();
+}
+
--
1.7.7.rc0.72.g4b5ea
- [Qemu-devel] [PATCH 16/21] qapi: Convert query-chardev, (continued)
- [Qemu-devel] [PATCH 16/21] qapi: Convert query-chardev, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 06/21] qapi: dealloc visitor, fix premature free and iteration logic, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 17/21] qapi: Convert query-commands, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 21/21] qapi: Convert system_powerdown, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 13/21] qapi: Convert query-kvm, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 14/21] qapi: Convert query-status, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 18/21] qapi: Convert quit,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 15/21] qapi: Convert query-uuid, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 19/21] qapi: Convert stop, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 10/21] qapi: modify visitor code generation for list iteration, Luiz Capitulino, 2011/09/28
- [Qemu-devel] [PATCH 20/21] qapi: Convert system_reset, Luiz Capitulino, 2011/09/28
- Re: [Qemu-devel] [PATCH v1 00/21]: First round of QAPI conversions, Anthony Liguori, 2011/09/29