qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v2 7/9] qmp: Add announce-self command


From: Dr. David Alan Gilbert (git)
Subject: [Qemu-devel] [PATCH v2 7/9] qmp: Add announce-self command
Date: Wed, 30 Jan 2019 10:32:34 +0000

From: "Dr. David Alan Gilbert" <address@hidden>

Add a qmp command that can trigger guest announcements.

It uses its own announce-timer instance, and parameters
passed to it explicitly in the command.

Like most qmp commands, it's in the main thread/bql, so
there's no racing with any outstanding timer.

Based on work of Germano Veit Michel <address@hidden> and
                 Vladislav Yasevich <address@hidden>

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
 net/announce.c |  8 ++++++++
 qapi/net.json  | 21 +++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/net/announce.c b/net/announce.c
index 070f37a7fa..8cd9f4d909 100644
--- a/net/announce.c
+++ b/net/announce.c
@@ -12,6 +12,7 @@
 #include "net/net.h"
 #include "qapi/clone-visitor.h"
 #include "qapi/qapi-visit-net.h"
+#include "qapi/qapi-commands-net.h"
 #include "trace.h"
 
 int64_t qemu_announce_timer_step(AnnounceTimer *timer)
@@ -131,3 +132,10 @@ void qemu_announce_self(AnnounceTimer *timer, 
AnnounceParameters *params)
         qemu_announce_timer_del(timer);
     }
 }
+
+void qmp_announce_self(AnnounceParameters *params, Error **errp)
+{
+    static AnnounceTimer announce_timer;
+    qemu_announce_self(&announce_timer, params);
+}
+
diff --git a/qapi/net.json b/qapi/net.json
index 5face0c14b..0710390747 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -707,3 +707,24 @@
             'max': 'int',
             'rounds': 'int',
             'step': 'int' } }
+
+##
+# @announce-self:
+#
+# Trigger generation of broadcast RARP frames to update network switches.
+# This can be useful when network bonds fail-over the active slave.
+#
+# @params: AnnounceParameters giving timing and repetition count of announce
+#
+# Example:
+#
+# -> { "execute": "announce-self"
+#      "arguments": { "params:" {
+#          "initial": 50, "max": 550, "rounds": 10, "step": 50 } } }
+# <- { "return": {} }
+#
+# Since: 4.0
+##
+{ 'command': 'announce-self',
+  'data' : {'params': 'AnnounceParameters'} }
+
-- 
2.20.1




reply via email to

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