@@ -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
@@ -652,3 +652,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);
+}
@@ -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
@@ -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)
@@ -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);
@@ -1113,3 +1113,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' }
@@ -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
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- hmp-commands.hx | 3 +-- hmp.c | 5 +++++ hmp.h | 1 + migration.c | 3 +-- migration.h | 2 -- qapi-schema.json | 13 +++++++++++++ qmp-commands.hx | 5 +---- 7 files changed, 22 insertions(+), 10 deletions(-)