@@ -366,7 +366,7 @@ ERST
{
.name = "cprsave",
.args_type = "file:s,mode:s",
- .params = "file 'reboot'",
+ .params = "file 'restart'|'reboot'",
.help = "create a checkpoint of the VM in file",
.cmd = hmp_cprsave,
},
@@ -379,6 +379,24 @@ If *mode* is 'reboot', the checkpoint remains valid after a host kexec
reboot, and guest ram must be backed by persistant shared memory. To
resume from the checkpoint, issue the quit command, reboot the system,
and issue the cprload command.
+
+If *mode* is 'restart', the checkpoint remains valid after restarting qemu,
+and guest ram must be allocated with the memfd-alloc machine option. To
+resume from the checkpoint, issue the cprexec command to restart, and issue
+the cprload command.
+ERST
+
+ {
+ .name = "cprexec",
+ .args_type = "command:S",
+ .params = "command",
+ .help = "Restart qemu by directly exec'ing command",
+ .cmd = hmp_cprexec,
+ },
+
+SRST
+``cprexec`` *command*
+Restart qemu by directly exec'ing *command*, replacing the qemu process.
ERST
{
@@ -60,6 +60,7 @@ void hmp_savevm(Monitor *mon, const QDict *qdict);
void hmp_delvm(Monitor *mon, const QDict *qdict);
void hmp_cprinfo(Monitor *mon, const QDict *qdict);
void hmp_cprsave(Monitor *mon, const QDict *qdict);
+void hmp_cprexec(Monitor *mon, const QDict *qdict);
void hmp_cprload(Monitor *mon, const QDict *qdict);
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
void hmp_migrate_continue(Monitor *mon, const QDict *qdict);
@@ -1213,6 +1213,17 @@ out:
hmp_handle_error(mon, err);
}
+void hmp_cprexec(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ const char *command = qdict_get_try_str(qdict, "command");
+ strList *args = strList_from_string(command, ' ');
+
+ qmp_cprexec(args, &err);
+ qapi_free_strList(args);
+ hmp_handle_error(mon, err);
+}
+
void hmp_cprload(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
cprsave <file> <mode> mode may be "restart" cprexec <command> Call cprexec(). Arguments: command : command line to execute, with space-separated arguments Signed-off-by: Steve Sistare <steven.sistare@oracle.com> --- hmp-commands.hx | 20 +++++++++++++++++++- include/monitor/hmp.h | 1 + monitor/hmp-cmds.c | 11 +++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-)