> -----Original Message----- > From: Jason Wang <jasow...@redhat.com> > Sent: Monday, December 28, 2020 3:11 PM > To: Zhang, Chen <chen.zh...@intel.com>; qemu-dev <qemu- > de...@nongnu.org>; Eric Blake <ebl...@redhat.com>; Dr. David Alan > Gilbert <dgilb...@redhat.com>; Markus Armbruster <arm...@redhat.com> > Cc: Zhang Chen <zhangc...@gmail.com> > Subject: Re: [PATCH 1/3] qapi/net: Add new QMP command for COLO > passthrough > > > On 2020/12/28 上午8:38, Zhang, Chen wrote: > > > >> -----Original Message----- > >> From: Jason Wang <jasow...@redhat.com> > >> Sent: Friday, December 25, 2020 2:20 PM > >> To: Zhang, Chen <chen.zh...@intel.com>; qemu-dev <qemu- > >> de...@nongnu.org>; Eric Blake <ebl...@redhat.com>; Dr. David Alan > >> Gilbert <dgilb...@redhat.com>; Markus Armbruster > <arm...@redhat.com> > >> Cc: Zhang Chen <zhangc...@gmail.com> > >> Subject: Re: [PATCH 1/3] qapi/net: Add new QMP command for COLO > >> passthrough > >> > >> > >> On 2020/12/24 上午9:09, Zhang Chen wrote: > >>> From: Zhang Chen <chen.zh...@intel.com> > >>> > >>> Since the real user scenario does not need to monitor all traffic. > >>> Add colo-passthrough-add and colo-passthrough-del to maintain a COLO > >>> network passthrough list. > >>> > >>> Signed-off-by: Zhang Chen <chen.zh...@intel.com> > >>> --- > >>> net/net.c | 12 ++++++++++++ > >>> qapi/net.json | 46 > >> ++++++++++++++++++++++++++++++++++++++++++++++ > >>> 2 files changed, 58 insertions(+) > >>> > >>> diff --git a/net/net.c b/net/net.c > >>> index e1035f21d1..eac7a92618 100644 > >>> --- a/net/net.c > >>> +++ b/net/net.c > >>> @@ -1151,6 +1151,18 @@ void qmp_netdev_del(const char *id, Error > >> **errp) > >>> qemu_del_net_client(nc); > >>> } > >>> > >>> +void qmp_colo_passthrough_add(const char *prot, const uint32_t port, > >>> + Error **errp) { > >>> + /* Setup passthrough connection */ } > >>> + > >>> +void qmp_colo_passthrough_del(const char *prot, const uint32_t port, > >>> + Error **errp) { > >>> + /* Delete passthrough connection */ } > >>> + > >>> static void netfilter_print_info(Monitor *mon, NetFilterState *nf) > >>> { > >>> char *str; > >>> diff --git a/qapi/net.json b/qapi/net.json index > >>> c31748c87f..466c29714e 100644 > >>> --- a/qapi/net.json > >>> +++ b/qapi/net.json > >>> @@ -714,3 +714,49 @@ > >>> ## > >>> { 'event': 'FAILOVER_NEGOTIATED', > >>> 'data': {'device-id': 'str'} } > >>> + > >>> +## > >>> +# @colo-passthrough-add: > >>> +# > >>> +# Add passthrough entry according to customer's needs in COLO- > compare. > >>> +# > >>> +# @protocol: COLO passthrough just support TCP and UDP. > >>> +# > >>> +# @port: TCP or UDP port number. > >>> +# > >>> +# Returns: Nothing on success > >>> +# > >>> +# Since: 5.3 > >>> +# > >>> +# Example: > >>> +# > >>> +# -> { "execute": "colo-passthrough-add", > >>> +# "arguments": { "protocol": "tcp", "port": 3389 } } > >>> +# <- { "return": {} } > >>> +# > >>> +## > >>> +{ 'command': 'colo-passthrough-add', > >>> + 'data': {'protocol': 'str', 'port': 'uint32'} } > >> > >> Do we plan to support 4-tuple (src ip,src port, dst ip, dst port) in > >> the future? If yes, let's add them now. > >> > >> And do we plan to support wildcard here? > > I think just using the port is enough for COLO compare. > > Because in this case, users need passthrough some guest services are > distinguished by static ports. > > And for support 4-tuple and wildcard are a good question, do you think > > we should add some passthrough Mechanism for all Qemu net filter? If yes, > we should support that in the future. > > > I think we can start form COLO. To avoid QMP compatibility issues, I would > like to add the n tuple and wildcard support now.
OK, I will do this job in next version. For the QMP compatibility issues, please give me a demo of what we want to see, Like some existing commands. Thanks Chen > > Thanks > > > > > > Thanks > > Chen > > > >> Thanks > >> > >> > >>> + > >>> +## > >>> +# @colo-passthrough-del: > >>> +# > >>> +# Delete passthrough entry according to customer's needs in COLO- > >> compare. > >>> +# > >>> +# @protocol: COLO passthrough just support TCP and UDP. > >>> +# > >>> +# @port: TCP or UDP port number. > >>> +# > >>> +# Returns: Nothing on success > >>> +# > >>> +# Since: 5.3 > >>> +# > >>> +# Example: > >>> +# > >>> +# -> { "execute": "colo-passthrough-del", > >>> +# "arguments": { "protocol": "tcp", "port": 3389 } } > >>> +# <- { "return": {} } > >>> +# > >>> +## > >>> +{ 'command': 'colo-passthrough-del', > >>> + 'data': {'protocol': 'str', 'port': 'uint32'} }