[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL V2 11/13] qmp: Add announce-self command
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL V2 11/13] qmp: Add announce-self command |
Date: |
Tue, 5 Mar 2019 15:12:18 +0800 |
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>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
net/announce.c | 7 +++++++
qapi/net.json | 20 ++++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/net/announce.c b/net/announce.c
index 070f37a..91e9a6e 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,9 @@ 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 5face0c..5f7bff1 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -707,3 +707,23 @@
'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": {
+# "initial": 50, "max": 550, "rounds": 10, "step": 50 } }
+# <- { "return": {} }
+#
+# Since: 4.0
+##
+{ 'command': 'announce-self', 'boxed': true,
+ 'data' : 'AnnounceParameters'}
--
2.5.0
- [Qemu-devel] [PULL V2 00/13] Net patches, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 01/13] net/colo-compare.c: Remove duplicated code, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 02/13] net: netmap: small improvements netmap_send(), Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 03/13] net: netmap: simplify netmap_receive(), Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 04/13] net: netmap: improve netmap_receive_iov(), Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 05/13] net: Introduce announce timer, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 06/13] migration: Add announce parameters, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 07/13] virtio-net: Switch to using announce timer, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 08/13] migration: Switch to using announce timer, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 09/13] net: Add a network device specific self-announcement ability, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 11/13] qmp: Add announce-self command,
Jason Wang <=
- [Qemu-devel] [PULL V2 10/13] virtio-net: Allow qemu_announce_self to trigger virtio announcements, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 12/13] hmp: Add hmp_announce_self, Jason Wang, 2019/03/05
- [Qemu-devel] [PULL V2 13/13] tests: Add a test for qemu self announcements, Jason Wang, 2019/03/05
- Re: [Qemu-devel] [PULL V2 00/13] Net patches, Peter Maydell, 2019/03/05