diff mbox

[10/12] hmp: Add hmp_announce_self

Message ID 1495649128-10529-11-git-send-email-vyasevic@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vlad Yasevich May 24, 2017, 6:05 p.m. UTC
Add an HMP command to trigger self annocements.

Signend-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 hmp-commands.hx | 14 ++++++++++++++
 hmp.c           |  5 +++++
 hmp.h           |  1 +
 3 files changed, 20 insertions(+)

Comments

Dr. David Alan Gilbert May 31, 2017, 9:47 a.m. UTC | #1
* Vladislav Yasevich (vyasevic@redhat.com) wrote:
> Add an HMP command to trigger self annocements.
> 
> Signend-off-by: Vladislav Yasevich <vyasevic@redhat.com>
       ^^

> ---
>  hmp-commands.hx | 14 ++++++++++++++
>  hmp.c           |  5 +++++
>  hmp.h           |  1 +
>  3 files changed, 20 insertions(+)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index c8dd816..0efe479 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -939,6 +939,20 @@ Set the parameter @var{parameter} for GARP/RARP announcements.
>  ETEXI
>  
>      {
> +        .name       = "qemu_announce_self",
> +        .args_type  = "",
> +        .params     = "",
> +        .help       = "Trigger GARP/RARP announcements",
> +        .cmd        = hmp_announce_self,
> +    },
> +
> +STEXI
> +@item qemu_announce_self
> +@findex qemu_announce_self
> +Trigger GARP/RARP announcements.

Yes, you could probably just call that 'announce_self';
if I understand then this version doesn't take any parameters
(unlike the qmp version) you just rely on the preset-configs.
That's OK if that mechanism stays the same.

Dave

> +ETEXI
> +
> +    {
>          .name       = "migrate",
>          .args_type  = "detach:-d,blk:-b,inc:-i,uri:s",
>          .params     = "[-d] [-b] [-i] uri",
> diff --git a/hmp.c b/hmp.c
> index 7d41783..f3c1f02 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1509,6 +1509,11 @@ void hmp_announce_set_parameter(Monitor *mon, const QDict *qdict)
>      }
>  }
>  
> +void hmp_announce_self(Monitor *mon, const QDict *qdict)
> +{
> +    qmp_announce_self(false, NULL, NULL);
> +}
> +
>  void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
>  {
>      qmp_migrate_cancel(NULL);
> diff --git a/hmp.h b/hmp.h
> index adf017c..fcb4be4 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -147,5 +147,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
>  void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
>  void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
>  void hmp_info_announce_parameters(Monitor *mon, const QDict *qdict);
> +void hmp_announce_self(Monitor *mon, const QDict *qdict);
>  
>  #endif
> -- 
> 2.7.4
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox

Patch

diff --git a/hmp-commands.hx b/hmp-commands.hx
index c8dd816..0efe479 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -939,6 +939,20 @@  Set the parameter @var{parameter} for GARP/RARP announcements.
 ETEXI
 
     {
+        .name       = "qemu_announce_self",
+        .args_type  = "",
+        .params     = "",
+        .help       = "Trigger GARP/RARP announcements",
+        .cmd        = hmp_announce_self,
+    },
+
+STEXI
+@item qemu_announce_self
+@findex qemu_announce_self
+Trigger GARP/RARP announcements.
+ETEXI
+
+    {
         .name       = "migrate",
         .args_type  = "detach:-d,blk:-b,inc:-i,uri:s",
         .params     = "[-d] [-b] [-i] uri",
diff --git a/hmp.c b/hmp.c
index 7d41783..f3c1f02 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1509,6 +1509,11 @@  void hmp_announce_set_parameter(Monitor *mon, const QDict *qdict)
     }
 }
 
+void hmp_announce_self(Monitor *mon, const QDict *qdict)
+{
+    qmp_announce_self(false, NULL, NULL);
+}
+
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict)
 {
     qmp_migrate_cancel(NULL);
diff --git a/hmp.h b/hmp.h
index adf017c..fcb4be4 100644
--- a/hmp.h
+++ b/hmp.h
@@ -147,5 +147,6 @@  void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
 void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
 void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
 void hmp_info_announce_parameters(Monitor *mon, const QDict *qdict);
+void hmp_announce_self(Monitor *mon, const QDict *qdict);
 
 #endif