]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hmp: Add hmp_announce_self
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 27 Feb 2019 13:24:12 +0000 (13:24 +0000)
committerJason Wang <jasowang@redhat.com>
Tue, 5 Mar 2019 03:27:41 +0000 (11:27 +0800)
Add an HMP command to trigger self annocements.
Unlike the QMP command (which takes a set of parameters), the HMP
command reuses the set of parameters used for migration.

Signend-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hmp-commands.hx
hmp.c
hmp.h
tests/test-hmp.c

index e5fbc2ca5978f89626123bb53f739306458a4716..9b4035965cddcdb78a78d2dd45c48a901571f647 100644 (file)
@@ -936,6 +936,22 @@ Bug: can screw up when the buffer contains invalid UTF-8 sequences,
 NUL characters, after the ring buffer lost data, and when reading
 stops because the size limit is reached.
 
+ETEXI
+
+    {
+        .name       = "announce_self",
+        .args_type  = "",
+        .params     = "",
+        .help       = "Trigger GARP/RARP announcements",
+        .cmd        = hmp_announce_self,
+    },
+
+STEXI
+@item announce_self
+@findex announce_self
+Trigger a round of GARP/RARP broadcasts; this is useful for explicitly updating the
+network infrastructure after a reconfiguration or some forms of migration.
+The timings of the round are set by the migration announce parameters.
 ETEXI
 
     {
diff --git a/hmp.c b/hmp.c
index f3db0bf5a2d96593a1c2dc9c21e3a3cd60e730d7..5f13b16e24d0982e087983f341d0498fb3e93a15 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1570,6 +1570,11 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
 
 }
 
+void hmp_announce_self(Monitor *mon, const QDict *qdict)
+{
+    qmp_announce_self(migrate_announce_params(), NULL);
+}
+
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
 {
     qmp_migrate_cancel(NULL);
diff --git a/hmp.h b/hmp.h
index 5f1addcca20e7b1fd8a126aea4b8e38425c51774..e0f32f04d3272a9ce33b53ce595d16ea65800c31 100644 (file)
--- a/hmp.h
+++ b/hmp.h
@@ -46,6 +46,7 @@ void hmp_sync_profile(Monitor *mon, const QDict *qdict);
 void hmp_system_reset(Monitor *mon, const QDict *qdict);
 void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
 void hmp_exit_preconfig(Monitor *mon, const QDict *qdict);
+void hmp_announce_self(Monitor *mon, const QDict *qdict);
 void hmp_cpu(Monitor *mon, const QDict *qdict);
 void hmp_memsave(Monitor *mon, const QDict *qdict);
 void hmp_pmemsave(Monitor *mon, const QDict *qdict);
index 1a3a9c50999640994ac87002ce51dbdcbc297f47..8c49d2fdf1e83a22b7ce3be7b1ddf89ba23eb882 100644 (file)
@@ -20,6 +20,7 @@
 static int verbose;
 
 static const char *hmp_cmds[] = {
+    "announce_self",
     "boot_set ndc",
     "chardev-add null,id=testchardev1",
     "chardev-send-break testchardev1",