@@ -2465,18 +2465,21 @@ static int do_closefd(Monitor *mon, const QDict *qdict, QObject **ret_data)
return -1;
}
-static void do_loadvm(Monitor *mon, const QDict *qdict)
+static int do_loadvm(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
+ int ret;
int saved_vm_running = vm_running;
const char *name = qdict_get_str(qdict, "name");
vm_stop(0);
- load_vmstate(name);
+ ret = load_vmstate(name);
if (saved_vm_running) {
vm_start();
}
+
+ return (ret < 0 ? -1 : 0);
}
int monitor_get_fd(Monitor *mon, const char *fdname)
@@ -260,7 +260,8 @@ ETEXI
.args_type = "name:s",
.params = "tag|id",
.help = "restore a VM snapshot from its tag or id",
- .mhandler.cmd = do_loadvm,
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_loadvm,
},
STEXI
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> --- monitor.c | 7 +++++-- qemu-monitor.hx | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-)