[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V1 04/32] savevm: HMP Command for cprsave
From: |
Steven Sistare |
Subject: |
Re: [PATCH V1 04/32] savevm: HMP Command for cprsave |
Date: |
Thu, 24 Sep 2020 17:44:05 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 9/11/2020 12:57 PM, Dr. David Alan Gilbert wrote:
> * Steve Sistare (steven.sistare@oracle.com) wrote:
>> Enable HMP access to the cprsave QMP command.
>>
>> Usage: cprsave <filename> <mode>
>>
>> Signed-off-by: Maran Wilson <maran.wilson@oracle.com>
>> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
>
> I realise that the current mode is currently only 'reboot' - can you
> please give us a clue as to why you've got a mode argument that's
> currently only got one mode?
Patch 14 adds the restart mode.
I factored the patches by capability to make the review easier, first
presenting the reboot patches, then the restart patches.
- Steve
>> ---
>> hmp-commands.hx | 18 ++++++++++++++++++
>> include/monitor/hmp.h | 1 +
>> monitor/hmp-cmds.c | 10 ++++++++++
>> 3 files changed, 29 insertions(+)
>>
>> diff --git a/hmp-commands.hx b/hmp-commands.hx
>> index 60f395c..c8defd9 100644
>> --- a/hmp-commands.hx
>> +++ b/hmp-commands.hx
>> @@ -354,6 +354,24 @@ SRST
>> ERST
>>
>> {
>> + .name = "cprsave",
>> + .args_type = "file:s,mode:s",
>> + .params = "file 'reboot'",
>> + .help = "create a checkpoint of the VM in file",
>> + .cmd = hmp_cprsave,
>> + },
>> +
>> +SRST
>> +``cprsave`` *tag*
>> + Stop VCPUs, create a checkpoint of the whole virtual machine and save it
>> + in *file*.
>> + If *mode* is 'reboot', the checkpoint can be cprload'ed after a host kexec
>> + reboot.
>> + exec() /usr/bin/qemu-exec if it exists, else exec
>> /usr/bin/qemu-system-x86_64,
>> + passing all the original command line arguments. The VCPUs remain paused.
>> +ERST
>> +
>> + {
>> .name = "delvm",
>> .args_type = "name:s",
>> .params = "tag",
>> diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
>> index c986cfd..af8ee23 100644
>> --- a/include/monitor/hmp.h
>> +++ b/include/monitor/hmp.h
>> @@ -59,6 +59,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict);
>> 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_cprsave(Monitor *mon, const QDict *qdict);
>> void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
>> void hmp_migrate_continue(Monitor *mon, const QDict *qdict);
>> void hmp_migrate_incoming(Monitor *mon, const QDict *qdict);
>> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
>> index ae4b6a4..59196ed 100644
>> --- a/monitor/hmp-cmds.c
>> +++ b/monitor/hmp-cmds.c
>> @@ -1139,6 +1139,16 @@ void hmp_announce_self(Monitor *mon, const QDict
>> *qdict)
>> qapi_free_AnnounceParameters(params);
>> }
>>
>> +void hmp_cprsave(Monitor *mon, const QDict *qdict)
>> +{
>> + Error *err = NULL;
>> +
>> + qmp_cprsave(qdict_get_try_str(qdict, "file"),
>> + qdict_get_try_str(qdict, "mode"),
>> + &err);
>> + hmp_handle_error(mon, err);
>> +}
>> +
>> void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
>> {
>> qmp_migrate_cancel(NULL);
>> --
>> 1.8.3.1
>>