qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/12] qmp: Expose qemu_announce_self as a qmp c


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 06/12] qmp: Expose qemu_announce_self as a qmp command
Date: Tue, 30 May 2017 15:14:00 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Wed, May 24, 2017 at 02:05:22PM -0400, Vladislav Yasevich wrote:
> Add a qmp command that can trigger guest announcements.
> 
> Based on work of Germano Veit Michel <address@hidden>
> 
> Signed-off-by: Vladislav Yasevich <address@hidden>
> ---
>  migration/savevm.c | 14 ++++++++++++++
>  qapi-schema.json   | 19 +++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index a4097c9..b55ce6a 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -265,6 +265,20 @@ void qemu_announce_self(AnnounceParameters *params)
>      qemu_announce_self_once(timer);
>  }
>  
> +void qmp_announce_self(bool has_params, AnnounceParameters *params,
> +                       Error **errp)
> +{
> +    AnnounceParameters announce_params;
> +
> +    memcpy(&announce_params, qemu_get_announce_params(),
> +           sizeof(announce_params));
> +
> +    if (has_params)
> +        qemu_set_announce_parameters(&announce_params, params);
> +
> +    qemu_announce_self(&announce_params);
> +}

I'm not a huge fan of the idea of setting announce parameters in a
global namespace, via a previously issued separate command.

I realize this is already done for the 'migrate' command, but there
it has been the cause of a number of bugs in libvirt mgmt of QEMU.
At least with migrate it makes sense for some parameters which need
to be tuned 'on the fly' after migrate already started. That doesn't
apply to this command though.

So I tend to think it'd be nicer to just make the parameters mandatory
for this command, so it is self-contanied does and not rely on previously
set (or potentially unknown/indeterminate) global state.

I'd also suggest that instad of adding an 'announce_set_parameters',
the parameters for the automatic announce at end of migration should
be set via the 'migrate_set_parameters' command.

> diff --git a/qapi-schema.json b/qapi-schema.json
> index 2030087..126b09d 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -654,6 +654,25 @@
>    'returns': 'AnnounceParameters' }
>  
>  ##
> +# @announce-self:
> +#
> +# Trigger generation of broadcast RARP frames to update network switches.
> +# This can be useful when network bonds fail-over the active slave.
> +#
> +# Arguments: None.

"None", but it has some arguments listed right below....

> +#
> +# Example:
> +#
> +# -> { "execute": "announce-self"
> +#      "arguments": { "announce-rounds": 5 } }
> +# <- { "return": {} }
> +#
> +# Since: 2.10
> +##
> +{ 'command': 'announce-self',
> +  'data' : {'*params': 'AnnounceParameters'} }
> +
> +##
>  # @MigrationStats:
>  #
>  # Detailed migration status.
> -- 
> 2.7.4
> 
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]