From a06cd488d83963faa4e7c1b8314c55f1e8f605e6 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 27 Feb 2019 13:24:11 +0000 Subject: qmp: Add announce-self command 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 and Vladislav Yasevich Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- net/announce.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'net') 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); +} -- cgit v1.1