qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration: expose qemu_announce_self() via qmp
@ 2017-01-17  5:26 Germano Veit Michel
  2017-01-17 11:41 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Germano Veit Michel @ 2017-01-17  5:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: quintela, amit.shah

qemu_announce_self() is triggered by qemu at the end of migrations
to update the network regarding the path to the guest l2addr.

however it is also useful when there is a network change such as
an active bond slave swap. Essentially, it's the same as a migration
from a network perspective - the guest moves to a different point
in the network topology.

this exposes the function via qmp.

Signed-off-by: Germano Veit Michel <germano@redhat.com>
---
 migration/savevm.c |  5 +++++
 qapi-schema.json   | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/migration/savevm.c b/migration/savevm.c
index f9c06e9..7a817dc 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -143,6 +143,11 @@ void qemu_announce_self(void)
     qemu_announce_self_once(&timer);
 }

+void qmp_announce_self(Error **errp)
+{
+    qemu_announce_self();
+}
+
 /***********************************************************/
 /* savevm/loadvm support */

diff --git a/qapi-schema.json b/qapi-schema.json
index ce20f16..6854266 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4786,3 +4786,21 @@
 # Since: 2.7
 ##
 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
+
+##
+# @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.
+#
+# Example:
+#
+# -> { "execute": "announce-self" }
+# <- { "return": {} }
+#
+# Since: 2.9
+##
+{ 'command': 'announce-self' }
+
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] migration: expose qemu_announce_self() via qmp
  2017-01-17  5:26 [Qemu-devel] [PATCH] migration: expose qemu_announce_self() via qmp Germano Veit Michel
@ 2017-01-17 11:41 ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Dr. David Alan Gilbert @ 2017-01-17 11:41 UTC (permalink / raw)
  To: Germano Veit Michel; +Cc: qemu-devel, amit.shah, quintela

* Germano Veit Michel (germano@redhat.com) wrote:
> qemu_announce_self() is triggered by qemu at the end of migrations
> to update the network regarding the path to the guest l2addr.
> 
> however it is also useful when there is a network change such as
> an active bond slave swap. Essentially, it's the same as a migration
> from a network perspective - the guest moves to a different point
> in the network topology.
> 
> this exposes the function via qmp.
> 
> Signed-off-by: Germano Veit Michel <germano@redhat.com>

Hi Germano,
  I think there are a couple of problems which mean it's
not quite this simple.

   a) The 'count' variable in qemu_announce_self_once is static
    initialised; so I think qemu will only ever run the announce
    series once; so it would do it after migrate, but then I think
    if you did a qemu_announce_self again I think it would send
    one packet and then not repeat it.
    Similarly if you called qemu_announce_self from qmp twice I'm
    not sure the 2nd time would only send the one packet.

   b) The static *time in qemu_announce_self means I'm worried about
    what happens if someone was to call qmp_announce_self before the
    previous round of qmp_announce_self had finished; I think you'd
    end up with 2 timers racing on one pointer.

Dave


> ---
>  migration/savevm.c |  5 +++++
>  qapi-schema.json   | 18 ++++++++++++++++++
>  2 files changed, 23 insertions(+)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index f9c06e9..7a817dc 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -143,6 +143,11 @@ void qemu_announce_self(void)
>      qemu_announce_self_once(&timer);
>  }
> 
> +void qmp_announce_self(Error **errp)
> +{
> +    qemu_announce_self();
> +}
> +
>  /***********************************************************/
>  /* savevm/loadvm support */
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index ce20f16..6854266 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -4786,3 +4786,21 @@
>  # Since: 2.7
>  ##
>  { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
> +
> +##
> +# @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.
> +#
> +# Example:
> +#
> +# -> { "execute": "announce-self" }
> +# <- { "return": {} }
> +#
> +# Since: 2.9
> +##
> +{ 'command': 'announce-self' }
> +
> -- 
> 2.9.3
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-17 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-17  5:26 [Qemu-devel] [PATCH] migration: expose qemu_announce_self() via qmp Germano Veit Michel
2017-01-17 11:41 ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).