[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V5 12/25] cpr: QMP interfaces for restart
From: |
Steven Sistare |
Subject: |
Re: [PATCH V5 12/25] cpr: QMP interfaces for restart |
Date: |
Mon, 12 Jul 2021 15:19:56 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/8/2021 11:49 AM, Marc-André Lureau wrote:
> Hi
>
> On Wed, Jul 7, 2021 at 9:33 PM Steve Sistare <steven.sistare@oracle.com
> <mailto:steven.sistare@oracle.com>> wrote:
>
> cprexec calls cprexec(). Syntax:
> { 'command': 'cprexec', 'data': { 'argv': [ 'str' ] } }
>
> Add the restart mode:
> { 'enum': 'CprMode', 'data': [ 'reboot', 'restart' ] }
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com
> <mailto:steven.sistare@oracle.com>>
> ---
> monitor/qmp-cmds.c | 5 +++++
> qapi/cpr.json | 16 +++++++++++++++-
> 2 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
> index 1128604..7326f7d 100644
> --- a/monitor/qmp-cmds.c
> +++ b/monitor/qmp-cmds.c
> @@ -179,6 +179,11 @@ void qmp_cprsave(const char *file, CprMode mode,
> Error **errp)
> cprsave(file, mode, errp);
> }
>
> +void qmp_cprexec(strList *args, Error **errp)
> +{
> + cprexec(args, errp);
> +}
> +
> void qmp_cprload(const char *file, Error **errp)
> {
> cprload(file, errp);
> diff --git a/qapi/cpr.json b/qapi/cpr.json
> index b6fdc89..2467e48 100644
> --- a/qapi/cpr.json
> +++ b/qapi/cpr.json
> @@ -16,10 +16,12 @@
> #
> # @reboot: checkpoint can be cprload'ed after a host kexec reboot.
> #
> +# @restart: checkpoint can be cprload'ed after restarting qemu.
> +#
> # Since: 6.1
> ##
> { 'enum': 'CprMode',
> - 'data': [ 'reboot' ] }
> + 'data': [ 'reboot', 'restart' ] }
>
>
> ##
> @@ -61,6 +63,18 @@
> 'mode': 'CprMode' } }
>
> ##
> +# @cprexec:
> +#
> +# Restart qemu.
> +#
> +# @argv: arguments to exec
>
>
> Why is it not then called cpr-restart ?
I'll change the description. exec is the key aspect to convey.
< Why does it take the whole argv?
It takes the whole argv because the caller may provide a prefix command to
modify the process context before executing qemu. We do that.
> Could argv be made optional?
If argv is omitted, I could exec the qemu binary with no args, but I don't
think that
would be useful. It may even be confusing, if the caller has a bug and passes
no args;
qemu would start and do nothing, rather than fail with an "exec failed" message.
- Steve
> +#
> +# Since: 6.1
> +##
> +{ 'command': 'cprexec',
> + 'data': { 'argv': [ 'str' ] } }
> +
> +##
> # @cprload:
> #
> # Start virtual machine from checkpoint file that was created earlier
> using
> --
> 1.8.3.1
>
>
>
>
> --
> Marc-André Lureau
[PATCH V5 11/25] cpr: restart mode, Steve Sistare, 2021/07/07