summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-11-27 22:54:09 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-12-06 11:40:01 -0200
commit6cdedb075f7a338bff7e97b3139bae5289157ae0 (patch)
tree3bbc008baa2422d63192ca84f13ba5079cb7df18
parentd51a67b4d3214654a7b100c0873b77cb2bf87f29 (diff)
downloadhqemu-6cdedb075f7a338bff7e97b3139bae5289157ae0.zip
hqemu-6cdedb075f7a338bff7e97b3139bae5289157ae0.tar.gz
qapi: Convert migrate_cancel
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--migration.c3
-rw-r--r--migration.h2
-rw-r--r--qapi-schema.json13
-rw-r--r--qmp-commands.hx5
7 files changed, 22 insertions, 10 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 131b21c..e48c2ca 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -771,8 +771,7 @@ ETEXI
.args_type = "",
.params = "",
.help = "cancel the current VM migration",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_migrate_cancel,
+ .mhandler.cmd = hmp_migrate_cancel,
},
STEXI
diff --git a/hmp.c b/hmp.c
index 934e931..92bb08f 100644
--- a/hmp.c
+++ b/hmp.c
@@ -662,3 +662,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
qmp_blockdev_snapshot_sync(device, filename, !!format, format, &errp);
hmp_handle_error(mon, &errp);
}
+
+void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
+{
+ qmp_migrate_cancel(NULL);
+}
diff --git a/hmp.h b/hmp.h
index e4227d3..2b0c1e4 100644
--- a/hmp.h
+++ b/hmp.h
@@ -46,5 +46,6 @@ void hmp_block_passwd(Monitor *mon, const QDict *qdict);
void hmp_balloon(Monitor *mon, const QDict *qdict);
void hmp_block_resize(Monitor *mon, const QDict *qdict);
void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict);
+void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
#endif
diff --git a/migration.c b/migration.c
index 8280d71..fa603d6 100644
--- a/migration.c
+++ b/migration.c
@@ -468,10 +468,9 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
return 0;
}
-int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)
+void qmp_migrate_cancel(Error **errp)
{
migrate_fd_cancel(migrate_get_current());
- return 0;
}
int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
diff --git a/migration.h b/migration.h
index 0682179..ff2e40b 100644
--- a/migration.h
+++ b/migration.h
@@ -42,8 +42,6 @@ int qemu_start_incoming_migration(const char *uri);
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data);
-int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data);
-
int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data);
uint64_t migrate_max_downtime(void);
diff --git a/qapi-schema.json b/qapi-schema.json
index 39bcc06..d638f12 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1127,3 +1127,16 @@
{ 'command': 'human-monitor-command',
'data': {'command-line': 'str', '*cpu-index': 'int'},
'returns': 'str' }
+
+##
+# @migrate_cancel
+#
+# Cancel the current executing migration process.
+#
+# Returns: nothing on success
+#
+# Notes: This command succeeds even if there is no migration process running.
+#
+# Since: 0.14.0
+##
+{ 'command': 'migrate_cancel' }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index d101426..5eb4b76 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -471,10 +471,7 @@ EQMP
{
.name = "migrate_cancel",
.args_type = "",
- .params = "",
- .help = "cancel the current VM migration",
- .user_print = monitor_user_noop,
- .mhandler.cmd_new = do_migrate_cancel,
+ .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
},
SQMP
OpenPOWER on IntegriCloud