[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V7 15/29] cpr: restart HMP interfaces
From: |
Steve Sistare |
Subject: |
[PATCH V7 15/29] cpr: restart HMP interfaces |
Date: |
Wed, 22 Dec 2021 11:05:20 -0800 |
cpr-save <filename> <mode>
mode may be "restart"
cpr-exec <command>
Call qmp_cpr_exec().
Arguments:
command : command line to execute, with space-separated arguments
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
hmp-commands.hx | 21 ++++++++++++++++++++-
include/monitor/hmp.h | 1 +
monitor/hmp-cmds.c | 11 +++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 350c886..0fd5b1b 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -353,7 +353,7 @@ ERST
{
.name = "cpr-save",
.args_type = "filename:s,mode:s",
- .params = "filename 'reboot'",
+ .params = "filename 'reboot'|'restart'",
.help = "create a checkpoint of the VM in file",
.cmd = hmp_cpr_save,
},
@@ -366,6 +366,25 @@ If *mode* is 'reboot', the checkpoint remains valid after
a host kexec
reboot, and guest ram must be backed by persistent shared memory. To
resume from the checkpoint, issue the quit command, reboot the system,
and issue the cpr-load command.
+
+If *mode* is 'restart', the checkpoint remains valid after restarting qemu
+using a subsequent cpr-exec. All guest RAM objects must be shared. The
+share=on property is required for memory created with an explicit -object
+option, and the memfd-alloc machine property is required for memory that is
+implicitly created. To resume from the checkpoint, issue the cpr-load command.
+ERST
+
+ {
+ .name = "cpr-exec",
+ .args_type = "command:S",
+ .params = "command",
+ .help = "Restart qemu by directly exec'ing command",
+ .cmd = hmp_cpr_exec,
+ },
+
+SRST
+``cpr-exec`` *command*
+Restart qemu by directly exec'ing *command*, replacing the qemu process.
ERST
{
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index b44588e..ec4fa44 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -60,6 +60,7 @@ void hmp_loadvm(Monitor *mon, const QDict *qdict);
void hmp_savevm(Monitor *mon, const QDict *qdict);
void hmp_delvm(Monitor *mon, const QDict *qdict);
void hmp_cpr_save(Monitor *mon, const QDict *qdict);
+void hmp_cpr_exec(Monitor *mon, const QDict *qdict);
void hmp_cpr_load(Monitor *mon, const QDict *qdict);
void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
void hmp_migrate_continue(Monitor *mon, const QDict *qdict);
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 5ca8b4b..39894d8 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1105,6 +1105,17 @@ out:
hmp_handle_error(mon, err);
}
+void hmp_cpr_exec(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ const char *command = qdict_get_try_str(qdict, "command");
+ strList *args = strList_from_string(command, ' ');
+
+ qmp_cpr_exec(args, &err);
+ qapi_free_strList(args);
+ hmp_handle_error(mon, err);
+}
+
void hmp_cpr_load(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
--
1.8.3.1
- [PATCH V7 06/29] cpr: reboot mode, (continued)
- [PATCH V7 06/29] cpr: reboot mode, Steve Sistare, 2021/12/22
- [PATCH V7 11/29] qapi: list utility functions, Steve Sistare, 2021/12/22
- [PATCH V7 09/29] oslib: qemu_clear_cloexec, Steve Sistare, 2021/12/22
- [PATCH V7 12/29] vl: helper to request re-exec, Steve Sistare, 2021/12/22
- [PATCH V7 03/29] migration: qemu file wrappers, Steve Sistare, 2021/12/22
- [PATCH V7 07/29] cpr: reboot HMP interfaces, Steve Sistare, 2021/12/22
- [PATCH V7 05/29] vl: start on wakeup request, Steve Sistare, 2021/12/22
- [PATCH V7 01/29] memory: qemu_check_ram_volatile, Steve Sistare, 2021/12/22
- [PATCH V7 04/29] migration: simplify savevm, Steve Sistare, 2021/12/22
- [PATCH V7 13/29] cpr: preserve extra state, Steve Sistare, 2021/12/22
- [PATCH V7 15/29] cpr: restart HMP interfaces,
Steve Sistare <=
- [PATCH V7 17/29] pci: export functions for cpr, Steve Sistare, 2021/12/22
- [PATCH V7 20/29] vfio-pci: cpr part 2 (msi), Steve Sistare, 2021/12/22
- [PATCH V7 19/29] vfio-pci: cpr part 1 (fd and dma), Steve Sistare, 2021/12/22
- [PATCH V7 16/29] hostmem-memfd: cpr for memory-backend-memfd, Steve Sistare, 2021/12/22
- [PATCH V7 14/29] cpr: restart mode, Steve Sistare, 2021/12/22
- [PATCH V7 18/29] vfio-pci: refactor for cpr, Steve Sistare, 2021/12/22
- [PATCH V7 25/29] chardev: cpr framework, Steve Sistare, 2021/12/22
- [PATCH V7 26/29] chardev: cpr for simple devices, Steve Sistare, 2021/12/22