[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V4 13/25] cpr: HMP interfaces for restart
|
From: |
Steve Sistare |
|
Subject: |
[PATCH V4 13/25] cpr: HMP interfaces for restart |
|
Date: |
Tue, 6 Jul 2021 09:45:44 -0700 |
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(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 015faae..1066fe7 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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
{
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index e4ebdf1..c26d0d7 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -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);
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index f902dcf..adffe80 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -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;
--
1.8.3.1
- [PATCH V4 02/25] cpr: reboot mode, (continued)
- [PATCH V4 02/25] cpr: reboot mode, Steve Sistare, 2021/07/06
- [PATCH V4 05/25] as_flat_walk, Steve Sistare, 2021/07/06
- [PATCH V4 03/25] cpr: QMP interfaces for reboot, Steve Sistare, 2021/07/06
- [PATCH V4 06/25] oslib: qemu_clr_cloexec, Steve Sistare, 2021/07/06
- [PATCH V4 07/25] machine: memfd-alloc option, Steve Sistare, 2021/07/06
- [PATCH V4 08/25] vl: add helper to request re-exec, Steve Sistare, 2021/07/06
- [PATCH V4 09/25] string to strList, Steve Sistare, 2021/07/06
- [PATCH V4 10/25] util: env var helpers, Steve Sistare, 2021/07/06
- [PATCH V4 12/25] cpr: QMP interfaces for restart, Steve Sistare, 2021/07/06
- [PATCH V4 11/25] cpr: restart mode, Steve Sistare, 2021/07/06
- [PATCH V4 13/25] cpr: HMP interfaces for restart,
Steve Sistare <=
- [PATCH V4 14/25] pci: export functions for cpr, Steve Sistare, 2021/07/06
- [PATCH V4 15/25] vfio-pci: refactor for cpr, Steve Sistare, 2021/07/06
- [PATCH V4 17/25] vfio-pci: cpr part 2, Steve Sistare, 2021/07/06
- [PATCH V4 19/25] hostmem-memfd: cpr support, Steve Sistare, 2021/07/06
- [PATCH V4 18/25] vhost: reset vhost devices upon cprsave, Steve Sistare, 2021/07/06
- [PATCH V4 21/25] chardev: cpr for simple devices, Steve Sistare, 2021/07/06
- [PATCH V4 20/25] chardev: cpr framework, Steve Sistare, 2021/07/06
- [PATCH V4 22/25] chardev: cpr for pty, Steve Sistare, 2021/07/06
- [PATCH V4 23/25] chardev: cpr for sockets, Steve Sistare, 2021/07/06