qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Chen <chen.zhang@intel.com >
To: Jason Wang <jasowang@redhat.com>,
	qemu-dev <qemu-devel@nongnu.org>, Eric Blake <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: Zhang Chen <chen.zhang@intel.com>, Zhang Chen <zhangckid@gmail.com>
Subject: [PATCH 2/3] hmp-commands: Add new HMP command for COLO passthrough
Date: Thu, 24 Dec 2020 09:09:17 +0800	[thread overview]
Message-ID: <20201224010918.19275-3-chen.zhang@intel.com> (raw)
In-Reply-To: <20201224010918.19275-1-chen.zhang@intel.com>

From: Zhang Chen <chen.zhang@intel.com>

Add hmp_colo_passthrough_add and hmp_colo_passthrough_del make user
can maintain COLO network passthrough list in human monitor.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 hmp-commands.hx       | 26 ++++++++++++++++++++++++++
 include/monitor/hmp.h |  2 ++
 monitor/hmp-cmds.c    | 20 ++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 470a420c2d..f5790782d6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1341,6 +1341,32 @@ SRST
   Remove host network device.
 ERST
 
+    {
+        .name       = "colo_passthrough_add",
+        .args_type  = "protocol:s,port:i",
+        .params     = "protocol port",
+        .help       = "Add network stream to colo passthrough list",
+        .cmd        = hmp_colo_passthrough_add,
+    },
+
+SRST
+``colo_passthrough_add``
+  Add network stream to colo passthrough list.
+ERST
+
+    {
+        .name       = "colo_passthrough_del",
+        .args_type  = "protocol:s,port:i",
+        .params     = "protocol port",
+        .help       = "Delete network stream from colo passthrough list",
+        .cmd        = hmp_colo_passthrough_del,
+    },
+
+SRST
+``colo_passthrough_del``
+  Delete network stream from colo passthrough list.
+ERST
+
     {
         .name       = "object_add",
         .args_type  = "object:O",
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index ed2913fd18..3c4943b09f 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -81,6 +81,8 @@ void hmp_device_del(Monitor *mon, const QDict *qdict);
 void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict);
 void hmp_netdev_add(Monitor *mon, const QDict *qdict);
 void hmp_netdev_del(Monitor *mon, const QDict *qdict);
+void hmp_colo_passthrough_add(Monitor *mon, const QDict *qdict);
+void hmp_colo_passthrough_del(Monitor *mon, const QDict *qdict);
 void hmp_getfd(Monitor *mon, const QDict *qdict);
 void hmp_closefd(Monitor *mon, const QDict *qdict);
 void hmp_sendkey(Monitor *mon, const QDict *qdict);
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 65d8ff4849..ab98a6b77d 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1661,6 +1661,26 @@ void hmp_netdev_del(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, err);
 }
 
+void hmp_colo_passthrough_add(Monitor *mon, const QDict *qdict)
+{
+    const char *prot = qdict_get_str(qdict, "protocol");
+    uint32_t port = qdict_get_int(qdict, "port");
+    Error *err = NULL;
+
+    qmp_colo_passthrough_add(prot, port, &err);
+    hmp_handle_error(mon, err);
+}
+
+void hmp_colo_passthrough_del(Monitor *mon, const QDict *qdict)
+{
+    const char *prot = qdict_get_str(qdict, "protocol");
+    uint32_t port = qdict_get_int(qdict, "port");
+    Error *err = NULL;
+
+    qmp_colo_passthrough_del(prot, port, &err);
+    hmp_handle_error(mon, err);
+}
+
 void hmp_object_add(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
-- 
2.17.1



  parent reply	other threads:[~2020-12-24  1:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24  1:09 [PATCH 0/3] Bypass specific network traffic in COLO Zhang Chen
2020-12-24  1:09 ` [PATCH 1/3] qapi/net: Add new QMP command for COLO passthrough Zhang Chen
2020-12-25  6:20   ` Jason Wang
2020-12-28  0:38     ` Zhang, Chen
2020-12-28  7:11       ` Jason Wang
2020-12-29  2:56         ` Zhang, Chen
2020-12-30  3:56           ` Jason Wang
2021-01-05  3:28             ` Zhang, Chen
2021-01-05  4:17               ` Jason Wang
2021-01-05  6:29                 ` Zhang, Chen
2021-01-19 19:32   ` Eric Blake
2021-01-21  1:50     ` Zhang, Chen
2020-12-24  1:09 ` Zhang Chen [this message]
2020-12-24  1:09 ` [PATCH 3/3] net/colo-compare: Add handler for passthrough connection Zhang Chen
2021-01-14 13:45   ` Lukas Straub
2021-01-15  9:07     ` Zhang, Chen
2021-01-15 16:06       ` Lukas Straub
2021-01-14 13:50   ` Lukas Straub
2021-01-15  9:08     ` Zhang, Chen
2020-12-25  6:23 ` [PATCH 0/3] Bypass specific network traffic in COLO Jason Wang
2020-12-28  0:38   ` Zhang, Chen
2021-01-04 13:06 ` Dr. David Alan Gilbert
2021-01-05  3:28   ` Zhang, Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201224010918.19275-3-chen.zhang@intel.com \
    --to=chen.zhang@intel.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhangckid@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).