Re: [Qemu-devel] [PATCH V3 2/3] net/filter-mirror:Add filter-redirector func

2016-03-07 Thread Zhang Chen
On 03/07/2016 03:56 PM, Jason Wang wrote: On 03/04/2016 08:01 PM, Zhang Chen wrote: Filter-redirector is a netfilter plugin. It gives qemu the ability to redirect net packet. redirector can redirect filter's net packet to outdev. and redirect indev's packet

Re: [Qemu-devel] [PATCH V3 3/3] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-07 Thread Zhang Chen
On 03/07/2016 04:10 PM, Jason Wang wrote: On 03/04/2016 08:01 PM, Zhang Chen wrote: In this unit test,we will test the filter redirector function. Case 1, tx traffic flow: qemu side | test side | +-+| +---+ | backend

[Qemu-devel] [PATCH] net/filter-mirror: Change filter_mirror_send interface

2016-03-07 Thread Zhang Chen
Change filter_mirror_send interface to make it easier to used by other filter Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by Li Zhijian --- net/filter-mirror.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/filter-mirror.c b/net

[Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()

2016-03-07 Thread Zhang Chen
This API will iterate the filters attached to netdev Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- include/net/filter.h | 10 +- net/filter-buffer.c | 2 +- net/filter.c | 12 ++-- 3 files changed, 12 insertions(+), 12 deletions

Re: [Qemu-devel] [PULL 00/14] Net patches

2016-03-08 Thread Zhang Chen
On 03/08/2016 03:56 PM, Jason Wang wrote: On 03/08/2016 03:50 PM, Wen Congyang wrote: On 03/08/2016 03:33 PM, Jason Wang wrote: On 03/08/2016 12:51 PM, Peter Maydell wrote: On 7 March 2016 at 10:12, Jason Wang wrote: The following changes since commit 1464ad45cd6cdeb0b5c1a54d3d3791396e47e

[Qemu-devel] [PATCH V8 0/2] net/filter-mirror:add filter-mirror and unit test

2016-03-09 Thread Zhang Chen
g's comments. - Address Dave's comments. v1: initial patch. Zhang Chen (2): net/filter-mirror:Add filter-mirror tests/test-filter-mirror:add filter-mirror unit test net/Makefile.objs | 1 + net/filter-mirror.c| 181 +++

[Qemu-devel] [PATCH V8 2/2] tests/test-filter-mirror:add filter-mirror unit test

2016-03-09 Thread Zhang Chen
=mirror0 We inject packet to netdev socket id = qtest-bn0, filter-mirror will copy and mirror the packet to mirror0. we read packet from mirror0 and then compare to what we inject. Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- tests/.gitignore | 1 + tests/Makefile

[Qemu-devel] [PATCH V8 1/2] net/filter-mirror:Add filter-mirror

2016-03-09 Thread Zhang Chen
Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. usage: -netdev tap,id=hn0 -chardev socket,id=mirror0,host=ip_primary,port=X,server,nowait -filter-mirror,id=m0,netdev=hn0,queue=tx/rx/all,outdev=mirror0 Signed-off-by: Zhang Chen Signed-off-by: Wen

Re: [Qemu-devel] [PATCH V8 1/2] net/filter-mirror:Add filter-mirror

2016-03-09 Thread Zhang Chen
On 03/09/2016 05:40 PM, Wen Congyang wrote: On 03/09/2016 05:07 PM, Zhang Chen wrote: Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. usage: -netdev tap,id=hn0 -chardev socket,id=mirror0,host=ip_primary,port=X,server,nowait -filter-mirror,id=m0

[Qemu-devel] [PATCH V8 0/2] net/filter-mirror:add filter-mirror and unit test

2016-03-09 Thread Zhang Chen
g's comments. - Address Dave's comments. v1: initial patch. Zhang Chen (2): net/filter-mirror:Add filter-mirror tests/test-filter-mirror:add filter-mirror unit test net/Makefile.objs | 1 + net/filter-mirror.c| 181 +++

[Qemu-devel] [PATCH V8 1/2] net/filter-mirror:Add filter-mirror

2016-03-09 Thread Zhang Chen
Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. usage: -netdev tap,id=hn0 -chardev socket,id=mirror0,host=ip_primary,port=X,server,nowait -filter-mirror,id=m0,netdev=hn0,queue=tx/rx/all,outdev=mirror0 Signed-off-by: Zhang Chen Signed-off-by: Wen

[Qemu-devel] [PATCH V8 2/2] tests/test-filter-mirror:add filter-mirror unit test

2016-03-09 Thread Zhang Chen
=mirror0 We inject packet to netdev socket id = qtest-bn0, filter-mirror will copy and mirror the packet to mirror0. we read packet from mirror0 and then compare to what we inject. Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- tests/.gitignore | 1 + tests/Makefile

[Qemu-devel] [PATCH V9 0/2] net/filter-mirror:add filter-mirror and unit test

2016-03-14 Thread Zhang Chen
comments. - Address Jason's comments. v2: - Address zhanghailiang's comments. - Address Eric Blake's comments. - Address Yang Hongyang's comments. - Address Dave's comments. v1: initial patch. Zhang Chen (2): net/filter-mirror:Add filter-mirror tests/test-fil

[Qemu-devel] [PATCH V9 1/2] net/filter-mirror:Add filter-mirror

2016-03-14 Thread Zhang Chen
Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. usage: -netdev tap,id=hn0 -chardev socket,id=mirror0,host=ip_primary,port=X,server,nowait -filter-mirror,id=m0,netdev=hn0,queue=tx/rx/all,outdev=mirror0 Signed-off-by: Zhang Chen Signed-off-by: Wen

[Qemu-devel] [PATCH V9 2/2] tests/test-filter-mirror:add filter-mirror unit test

2016-03-14 Thread Zhang Chen
-bn0,queue=tx,outdev=mirror0 We inject packet to netdev socket id = qtest-bn0, filter-mirror will copy and mirror the packet to mirror0. we read packet from mirror0 and then compare to what we inject. Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- tests/.gitignore | 1

Re: [Qemu-devel] [PATCH V9 0/2] net/filter-mirror:add filter-mirror and unit test

2016-03-15 Thread Zhang Chen
On 03/15/2016 03:18 PM, Wen Congyang wrote: On 03/15/2016 03:04 PM, Jason Wang wrote: On 03/15/2016 01:38 PM, Zhang Chen wrote: Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. v9: - add qmp("{ 'execute' : 'query-s

[Qemu-devel] [PATCH V10 1/2] net/filter-mirror:Add filter-mirror

2016-03-15 Thread Zhang Chen
Filter-mirror is a netfilter plugin. It gives qemu the ability to mirror packets to a chardev. usage: -netdev tap,id=hn0 -chardev socket,id=mirror0,host=ip_primary,port=X,server,nowait -filter-mirror,id=m0,netdev=hn0,queue=tx/rx/all,outdev=mirror0 Signed-off-by: Zhang Chen Signed-off-by: Wen

[Qemu-devel] [PATCH V10 2/2] tests/test-filter-mirror:add filter-mirror unit test

2016-03-15 Thread Zhang Chen
-bn0,queue=tx,outdev=mirror0 We inject packet to netdev socket id = qtest-bn0, filter-mirror will copy and mirror the packet to mirror0. we read packet from mirror0 and then compare to what we inject. Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- tests/.gitignore | 1

[Qemu-devel] [PATCH V10 0/2] net/filter-mirror:add filter-mirror and unit test

2016-03-15 Thread Zhang Chen
7;s comments - Address zhanghailiang's comments. - Address Jason's comments. v2: - Address zhanghailiang's comments. - Address Eric Blake's comments. - Address Yang Hongyang's comments. - Address Dave's comments. v1: initial patch. Zhang Chen (2): net/fi

[Qemu-devel] [PATCH V4 0/2] Introduce filter-redirector

2016-03-15 Thread Zhang Chen
ad, most code is stolen from net_socket_send - fix comments error - add some comments v3: -Address Jason's comments. v2: - Address Jason's comments. - Add filter-traffic.h to reuse parts of the codes - Add unit test case v1: initial patch. Zhang Chen (2): net/filter-mirror: im

[Qemu-devel] [PATCH V2] net/filter-mirror: Change filter_mirror_send interface

2016-03-15 Thread Zhang Chen
Change filter_mirror_send interface to make it easier to used by other filter Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-mirror.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/filter-mirror.c b/net/filter

[Qemu-devel] [PATCH V4 2/2] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-15 Thread Zhang Chen
ect filter-redirector,id=qtest-f0,netdev=qtest-bn0," "queue=rx,outdev=redirector0 " "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," "queue=rx,indev=redirector2 " "-object filter-redirector,id=qtest-f2,netdev=qtest-b

[Qemu-devel] [PATCH V4 1/2] net/filter-mirror: implement filter-redirector

2016-03-15 Thread Zhang Chen
r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-mirror.c | 236 qemu-options.hx | 9 ++ vl.c| 3 +- 3 files changed, 247 ins

[Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare

2016-03-30 Thread Zhang Chen
COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. v2: - add jhash.h v1: - initial patch Zhang Chen (3): colo-compare: introduce colo compare initlization colo-compare: track connection and enqueue packet colo

[Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet

2016-03-30 Thread Zhang Chen
packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 59 ++ net/colo-compare.c

[Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization

2016-03-30 Thread Zhang Chen
packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 344

[Qemu-devel] [PATCH V2 3/3] colo-compare: introduce packet comparison thread

2016-03-30 Thread Zhang Chen
if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 122 - 1 file changed, 121

Re: [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization

2016-03-30 Thread Zhang Chen
On 03/30/2016 05:25 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop Please put in the description an example of how you invoke the filter on the

Re: [Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet

2016-03-30 Thread Zhang Chen
On 03/30/2016 06:36 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState

Re: [Qemu-devel] [PATCH V2 2/3] colo-compare: track connection and enqueue packet

2016-03-30 Thread Zhang Chen
On 03/31/2016 12:23 PM, Li Zhijian wrote: On 03/31/2016 12:06 PM, Zhang Chen wrote: +static void packet_destroy(void *opaque, void *user_data) +{ +Packet *pkt = opaque; + +g_free(pkt->data); +g_slice_free(Packet, pkt); +} + +static inline void colo_flush_connection(void *opa

Re: [Qemu-devel] [PATCH V2 3/3] colo-compare: introduce packet comparison thread

2016-03-30 Thread Zhang Chen
On 03/30/2016 07:41 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen

Re: [Qemu-devel] [PATCH V2 0/3] Introduce COLO-compare

2016-03-30 Thread Zhang Chen
On 03/30/2016 08:05 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. Hi Zhang Chen, I've put comments on the indiv

Re: [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization

2016-03-31 Thread Zhang Chen
On 03/31/2016 09:41 AM, Zhang Chen wrote: On 03/30/2016 05:25 PM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop Please put in the description

Re: [Qemu-devel] [PATCH COLO-Frame v16 for-2.7 00/35] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-04-08 Thread Zhang Chen
, please update this new branch~ Thanks Zhang Chen There are little changes for this series except the netfilter releated part. Patch status: Unreviewed: patch 21, 32 ~ 35 Updated: patch 7, 13, 32 ~ 35 Cc: Jason Wang TODO: 1. Checkpoint based on proxy in qemu 2. The capability of continuous FT 3

Re: [Qemu-devel] [PATCH V2 1/3] colo-compare: introduce colo compare initlization

2016-04-12 Thread Zhang Chen
+if (!size) { +return 0; +} + +ret = qemu_chr_fe_write_all(out, (uint8_t *)&len, sizeof(len)); +if (ret != sizeof(len)) { +goto err; +} + +ret = qemu_chr_fe_write_all(out, (uint8_t *)buf, size); +if (ret != size) { +goto err; +} + You can ma

[Qemu-devel] [RFC PATCH V3 0/4] Introduce COLO-compare

2016-04-18 Thread Zhang Chen
-compare to colo-frame v2.7 - fix most of Dave's comments (except RCU) - add TCP,UDP,ICMP and other packet comparison - add trace-event - add some comments - other bug fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (4): colo-co

[Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-18 Thread Zhang Chen
=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 361 + qemu

[Qemu-devel] [RFC PATCH V3 3/4] colo-compare: introduce packet comparison thread

2016-04-18 Thread Zhang Chen
if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 126 + trace-events

[Qemu-devel] [RFC PATCH V3 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-04-18 Thread Zhang Chen
Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 158 +++-- 1 file changed, 154 insertions(+), 4 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 4b5a2d4..3dad461

[Qemu-devel] [RFC PATCH V3 2/4] colo-compare: track connection and enqueue packet

2016-04-18 Thread Zhang Chen
packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 59 ++ net/colo-compare.c

Re: [Qemu-devel] [RFC PATCH V3 0/4] Introduce COLO-compare

2016-04-27 Thread Zhang Chen
Ping... This patch has been no news for a week~~~ Thanks zhang chen On 04/18/2016 07:11 PM, Zhang Chen wrote: COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. We rebase colo-compare to colo-frame v2.7 you can get

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-28 Thread Zhang Chen
On 04/28/2016 02:53 PM, Jason Wang wrote: On 04/18/2016 07:11 PM, Zhang Chen wrote: packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop usage: primary: -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-28 Thread Zhang Chen
On 04/28/2016 03:16 PM, Jason Wang wrote: On 04/28/2016 02:53 PM, Jason Wang wrote: +static void compare_set_outdev(Object *obj, const char *value, Error **errp) +{ +CompareState *s = COLO_COMPARE(obj); + +g_free(s->outdev); +s->outdev = g_strdup(value); +} + +/* + * called from

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-28 Thread Zhang Chen
On 04/28/2016 04:17 PM, Jason Wang wrote: On 04/28/2016 03:55 PM, Zhang Chen wrote: On 04/28/2016 03:16 PM, Jason Wang wrote: On 04/28/2016 02:53 PM, Jason Wang wrote: +static void compare_set_outdev(Object *obj, const char *value, Error **errp) +{ +CompareState *s = COLO_COMPARE(obj

Re: [Qemu-devel] [RFC PATCH V3 2/4] colo-compare: track connection and enqueue packet

2016-04-28 Thread Zhang Chen
On 04/28/2016 03:47 PM, Jason Wang wrote: On 04/18/2016 07:11 PM, Zhang Chen wrote: In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState ++ | | +---+ +---+ +---+ |conn

Re: [Qemu-devel] [RFC PATCH V3 3/4] colo-compare: introduce packet comparison thread

2016-04-28 Thread Zhang Chen
On 04/28/2016 03:58 PM, Jason Wang wrote: On 04/18/2016 07:11 PM, Zhang Chen wrote: if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-28 Thread Zhang Chen
On 04/29/2016 04:55 AM, Eric Blake wrote: On 04/18/2016 05:11 AM, Zhang Chen wrote: s/initlization/initialization/ in the subject OK~ packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop Grammar suggestion: Packets coming from the

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-04-28 Thread Zhang Chen
On 04/29/2016 10:03 AM, Jason Wang wrote: On 04/28/2016 05:04 PM, Zhang Chen wrote: On 04/28/2016 04:17 PM, Jason Wang wrote: On 04/28/2016 03:55 PM, Zhang Chen wrote: On 04/28/2016 03:16 PM, Jason Wang wrote: On 04/28/2016 02:53 PM, Jason Wang wrote: +static void compare_set_outdev

Re: [Qemu-devel] [RFC PATCH V3 2/4] colo-compare: track connection and enqueue packet

2016-04-29 Thread Zhang Chen
On 04/29/2016 10:05 AM, Jason Wang wrote: On 04/28/2016 06:25 PM, Zhang Chen wrote: +static Packet *packet_new(CompareState *s, const void *data, + int size, ConnectionKey *key) +{ +Packet *pkt = g_slice_new(Packet); + +pkt->data = g_memdup(data, s

Re: [Qemu-devel] [RFC PATCH V3 3/4] colo-compare: introduce packet comparison thread

2016-04-29 Thread Zhang Chen
On 04/29/2016 10:07 AM, Jason Wang wrote: On 04/28/2016 06:31 PM, Zhang Chen wrote: +/* + * called from the compare thread on the primary + * for compare connection + */ +static void colo_compare_connection(void *opaque, void *user_data) +{ +Connection *conn = opaque; +Packet *pkt

Re: [Qemu-devel] [RFC PATCH V3 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-05-04 Thread Zhang Chen
On 04/29/2016 03:44 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 158 +++-- 1 file changed

Re: [Qemu-devel] [RFC PATCH V3 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-05-04 Thread Zhang Chen
On 05/05/2016 11:03 AM, Zhang Chen wrote: On 04/29/2016 03:44 AM, Dr. David Alan Gilbert wrote: * Zhang Chen (zhangchen.f...@cn.fujitsu.com) wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 158

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-05-05 Thread Zhang Chen
On 04/29/2016 10:03 AM, Jason Wang wrote: On 04/28/2016 05:04 PM, Zhang Chen wrote: On 04/28/2016 04:17 PM, Jason Wang wrote: On 04/28/2016 03:55 PM, Zhang Chen wrote: On 04/28/2016 03:16 PM, Jason Wang wrote: On 04/28/2016 02:53 PM, Jason Wang wrote: +static void compare_set_outdev

[Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-06 Thread Zhang Chen
Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/net/net.h | 8 ++ net/filter-mirror.c | 60 net/net.c | 56 ++ net/socket.c| 71

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-05-09 Thread Zhang Chen
with select(2)/poll(2)... - compare packet } Yes, something like this. But remove qemu_chr_add_handlers I can't get fd to select/poll. How to get fd from all kinds of chardev? Thanks Zhang Chen This solution will lead comparing packet and reading packet in serial. But i don't know if this w

Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-09 Thread Zhang Chen
On 05/10/2016 10:57 AM, Li Zhijian wrote: On 05/06/2016 06:56 PM, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/net/net.h | 8 ++ net/filter-mirror.c | 60 net/net.c

[Qemu-devel] [PATCH V5 2/2] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-16 Thread Zhang Chen
ect filter-redirector,id=qtest-f0,netdev=qtest-bn0," "queue=rx,outdev=redirector0 " "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," "queue=rx,indev=redirector2 " "-object filter-redirector,id=qtest-f2,netdev=qtest-b

[Qemu-devel] [PATCH V5 0/2] Introduce filter-redirector

2016-03-16 Thread Zhang Chen
de is stolen from net_socket_send - fix comments error - add some comments v3: -Address Jason's comments. v2: - Address Jason's comments. - Add filter-traffic.h to reuse parts of the codes - Add unit test case v1: initial patch. Zhang Chen (2): net/filter-mirror: impl

[Qemu-devel] [PATCH V5 1/2] net/filter-mirror: implement filter-redirector

2016-03-16 Thread Zhang Chen
server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-m

Re: [Qemu-devel] [PATCH V5 1/2] net/filter-mirror: implement filter-redirector

2016-03-18 Thread Zhang Chen
On 03/17/2016 02:43 PM, Jason Wang wrote: On 03/16/2016 06:38 PM, Zhang Chen wrote: Filter-redirector is a netfilter plugin. It gives qemu the ability to redirect net packet. redirector can redirect filter's net packet to outdev. and redirect indev's packet

[Qemu-devel] [PATCH V6 2/2] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-19 Thread Zhang Chen
ect filter-redirector,id=qtest-f0,netdev=qtest-bn0," "queue=rx,outdev=redirector0 " "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," "queue=rx,indev=redirector2 " "-object filter-redirector,id=qtest-f2,netdev=qtest-b

[Qemu-devel] [PATCH V6 0/2] Introduce filter-redirector

2016-03-19 Thread Zhang Chen
in_dev to filter's next - rework redirector_chr_read, most code is stolen from net_socket_send - fix comments error - add some comments v3: -Address Jason's comments. v2: - Address Jason's comments. - Add filter-traffic.h to reuse parts of the codes - Add unit test case v1

[Qemu-devel] [PATCH V7 0/2] Introduce filter-redirector

2016-03-19 Thread Zhang Chen
son's comments. - Add filter-traffic.h to reuse parts of the codes - Add unit test case v1: initial patch. Zhang Chen (2): net/filter-mirror: implement filter-redirector tests/test-filter-redirector: Add unit test for filter-redirector net/filter-mirror.c| 244 +

[Qemu-devel] [PATCH V7 2/2] tests/test-filter-redirector: Add unit test for filter-redirector

2016-03-19 Thread Zhang Chen
ect filter-redirector,id=qtest-f0,netdev=qtest-bn0," "queue=rx,outdev=redirector0 " "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," "queue=rx,indev=redirector2 " "-object filter-redirector,id=qtest-f2,netdev=qtest-b

[Qemu-devel] [PATCH V7 1/2] net/filter-mirror: implement filter-redirector

2016-03-19 Thread Zhang Chen
server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-m

[Qemu-devel] [PATCH V6 1/2] net/filter-mirror: implement filter-redirector

2016-03-20 Thread Zhang Chen
server,nowait -chardev socket,id=s1,host=ip_primary,port=Y,server,nowait -filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1 Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- net/filter-m

[Qemu-devel] [PATCH V1 3/3] colo-compare: introduce packet comparison thread

2016-03-25 Thread Zhang Chen
if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 122 - 1 file changed, 121

[Qemu-devel] [PATCH V1 2/3] colo-compare: track connection and enqueue packet

2016-03-25 Thread Zhang Chen
packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 324 - 1 file change

[Qemu-devel] [PATCH V1 1/3] colo-compare: introduce colo compare initlization

2016-03-25 Thread Zhang Chen
packet come from primary char indev will be send to outdev - packet come from secondary char dev will be drop Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 344

[Qemu-devel] [PATCH V1 0/3] Introduce COLO-compare

2016-03-25 Thread Zhang Chen
COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. v1: - initial patch Zhang Chen (3): colo-compare: introduce colo compare initlization colo-compare: track connection and enqueue packet colo-compare: introduce

[Qemu-devel] [RFC PATCH V4 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-05-25 Thread Zhang Chen
Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 179 ++--- trace-events | 6 ++ 2 files changed, 178 insertions(+), 7 deletions(-) diff --git a/net/colo-compare.c b/net/colo

[Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-05-25 Thread Zhang Chen
add some comments - other bug fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (4): colo-compare: introduce colo compare initialization colo-compare: track connection and enqueue packet colo-compare: introduce packet comparison thread

[Qemu-devel] [RFC PATCH V4 2/4] colo-compare: track connection and enqueue packet

2016-05-25 Thread Zhang Chen
packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 + net/Makefile.objs| 1 + net/colo-base.c

[Qemu-devel] [RFC PATCH V4 3/4] colo-compare: introduce packet comparison thread

2016-05-25 Thread Zhang Chen
if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 172

[Qemu-devel] [RFC PATCH V4 1/4] colo-compare: introduce colo compare initialization

2016-05-25 Thread Zhang Chen
-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 299

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-05-30 Thread Zhang Chen
On 05/30/2016 11:19 AM, Jason Wang wrote: On 2016年05月25日 20:50, Zhang Chen wrote: COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. the full version in this github: https://github.com/zhangckid/qemu/tree/colo

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-05-31 Thread Zhang Chen
On 05/31/2016 02:16 PM, Jason Wang wrote: On 2016年05月31日 11:54, Zhang Chen wrote: On 05/30/2016 11:19 AM, Jason Wang wrote: On 2016年05月25日 20:50, Zhang Chen wrote: COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do

[Qemu-devel] [RFC PATCH 1/3] filter-rewriter: introduce filter-rewriter initialization

2016-06-14 Thread Zhang Chen
=red1 -object filter-rewriter,id=rew0,netdev=hn0,queue=all Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/filter-rewriter.c | 112 ++ qemu-options.hx | 10 +

[Qemu-devel] [RFC PATCH 3/3] filter-rewriter: rewrite tcp packet to keep secondary connection

2016-06-14 Thread Zhang Chen
We will rewrite tcp packet secondary received and sent. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/filter-rewriter.c | 94 +-- trace-events | 3 ++ 2 files changed, 95 insertions(+), 2

[Qemu-devel] [RFC PATCH 2/3] filter-rewriter: track connection and parse packet

2016-06-14 Thread Zhang Chen
We use colo-base.h to track connection and parse packet Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/filter-rewriter.c | 53 +++ 1 file changed, 53 insertions(+) diff --git a/net/filter-rewriter.c b

[Qemu-devel] [RFC PATCH 0/3] filter-rewriter: introduce filter-rewriter

2016-06-14 Thread Zhang Chen
Filter-rewriter is a part of COLO project. It will rewrite some of secondary packet to make secondary guest's connection established successfully. Zhang Chen (3): filter-rewriter: introduce filter-rewriter initialization filter-rewriter: track connection and parse packet filter-rew

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-06-16 Thread Zhang Chen
On 05/31/2016 07:06 PM, Jason Wang wrote: On 2016年05月31日 16:28, Zhang Chen wrote: On 05/31/2016 02:16 PM, Jason Wang wrote: On 2016年05月31日 11:54, Zhang Chen wrote: On 05/30/2016 11:19 AM, Jason Wang wrote: On 2016年05月25日 20:50, Zhang Chen wrote: COLO-compare is a part of COLO

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-06-19 Thread Zhang Chen
On 06/20/2016 11:03 AM, Jason Wang wrote: On 2016年06月17日 10:25, Zhang Chen wrote: Hi~ jason. I tried a lot of ways to make it run in compare thread, but it not work. Because that: void g_main_context_push_thread_default (GMainContext *context); Acquires context and sets it as the thread

[Qemu-devel] [RFC PATCH] Change g_source_attach(xx, NULL) to g_souce_attach(xx, g_main_context_get_thread_default())

2016-06-20 Thread Zhang Chen
. Comments form jason. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- io/channel.c | 2 +- qemu-char.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io/channel.c b/io/channel.c index 692eb17..cd25677 100644 --- a/io/channel.c +++ b/io/channel.c @@ -146,7

Re: [Qemu-devel] [RFC PATCH] Change g_source_attach(xx, NULL) to g_souce_attach(xx, g_main_context_get_thread_default())

2016-06-20 Thread Zhang Chen
On 06/20/2016 04:52 PM, Paolo Bonzini wrote: On 20/06/2016 10:23, Zhang Chen wrote: We want to poll and handle chardev in another thread other than main loop. Can you explain this better? For example, we use this in codes: +qemu_chr_add_handlers(s->chr_sec_in, compare_chr_can_r

Re: [Qemu-devel] [RFC PATCH] Change g_source_attach(xx, NULL) to g_souce_attach(xx, g_main_context_get_thread_default())

2016-06-20 Thread Zhang Chen
On 06/21/2016 12:45 AM, Eric Blake wrote: On 06/20/2016 02:23 AM, Zhang Chen wrote: Subject line is too long, missing a 'topic:' prefix, and has a typo (souce). Suggest: qemu-char: Fix context for g_source_attach() OK~~ I will fix it in next version. We want to poll and hand

Re: [Qemu-devel] [RFC PATCH 3/3] filter-rewriter: rewrite tcp packet to keep secondary connection

2016-06-21 Thread Zhang Chen
On 06/20/2016 08:14 PM, Dr. David Alan Gilbert wrote: * Jason Wang (jasow...@redhat.com) wrote: On 2016年06月14日 19:15, Zhang Chen wrote: We will rewrite tcp packet secondary received and sent. More verbose please. E.g which fields were rewrote and why. OK. Signed-off-by: Zhang Chen

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-06-21 Thread Zhang Chen
On 06/20/2016 01:24 PM, Jason Wang wrote: On 2016年06月20日 11:27, Zhang Chen wrote: On 06/20/2016 11:03 AM, Jason Wang wrote: On 2016年06月17日 10:25, Zhang Chen wrote: Hi~ jason. I tried a lot of ways to make it run in compare thread, but it not work. Because that: void

Re: [Qemu-devel] [RFC PATCH V4 0/4] Introduce COLO-compare

2016-06-22 Thread Zhang Chen
On 06/22/2016 02:48 PM, Jason Wang wrote: On 2016年06月22日 14:24, Zhang Chen wrote: On 06/20/2016 01:24 PM, Jason Wang wrote: On 2016年06月20日 11:27, Zhang Chen wrote: On 06/20/2016 11:03 AM, Jason Wang wrote: On 2016年06月17日 10:25, Zhang Chen wrote: Hi~ jason. I tried a lot of ways

[Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-06-22 Thread Zhang Chen
. Comments from jason. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- io/channel.c | 2 +- qemu-char.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io/channel.c b/io/channel.c index 692eb17..cd25677 100644 --- a/io/channel.c +++ b/io/channel.c @@ -146,7

Re: [Qemu-devel] [RFC PATCH 3/3] filter-rewriter: rewrite tcp packet to keep secondary connection

2016-06-23 Thread Zhang Chen
On 06/22/2016 02:34 PM, Jason Wang wrote: On 2016年06月22日 11:12, Zhang Chen wrote: On 06/20/2016 08:14 PM, Dr. David Alan Gilbert wrote: * Jason Wang (jasow...@redhat.com) wrote: On 2016年06月14日 19:15, Zhang Chen wrote: We will rewrite tcp packet secondary received and sent. More

[Qemu-devel] [RFC PATCH V5 4/4] colo-compare: add TCP, UDP, ICMP packet comparison

2016-06-23 Thread Zhang Chen
Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 171 +++-- trace-events | 6 ++ 2 files changed, 173 insertions(+), 4 deletions(-) diff --git a/net/colo-compare.c b/net/colo

[Qemu-devel] [RFC PATCH V5 3/4] colo-compare: introduce packet comparison thread

2016-06-23 Thread Zhang Chen
if packets are same, we send primary packet and drop secondary packet, otherwise notify COLO do checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-base.c| 1 + net/colo-base.h| 3 + net/colo-compare.c | 214

[Qemu-devel] [RFC PATCH V5 0/4] Introduce COLO-compare

2016-06-23 Thread Zhang Chen
add TCP,UDP,ICMP and other packet comparison - add trace-event - add some comments - other bug fix - add RFC index - add usage in patch 1/4 v2: - add jhash.h v1: - initial patch Zhang Chen (4): colo-compare: introduce colo compare initialization colo-compare: track connection

[Qemu-devel] [RFC PATCH V5 2/4] colo-compare: track connection and enqueue packet

2016-06-23 Thread Zhang Chen
packet | |packet +|packet | |packet + ++ ++++ ++ Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 net/Makefile.objs| 1 + net/colo-base.c

[Qemu-devel] [RFC PATCH V5 1/4] colo-compare: introduce colo compare initialization

2016-06-23 Thread Zhang Chen
-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-compare.c | 231

Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-11 Thread Zhang Chen
On 05/10/2016 10:57 AM, Li Zhijian wrote: On 05/06/2016 06:56 PM, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/net/net.h | 8 ++ net/filter-mirror.c | 60 net/net.c

Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-11 Thread Zhang Chen
On 05/11/2016 05:01 PM, Jason Wang wrote: On 2016年05月06日 18:56, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang Looks good, just few nits. It's better to have a commit log. OK, I will add this log: This function is from net/soc

Re: [Qemu-devel] [PATCH] net/net: Add ReadState for reuse codes

2016-05-11 Thread Zhang Chen
On 05/12/2016 09:11 AM, Jason Wang wrote: On 2016年05月11日 19:20, Zhang Chen wrote: On 05/11/2016 05:01 PM, Jason Wang wrote: On 2016年05月06日 18:56, Zhang Chen wrote: Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang Looks good, just few nits. It&#

Re: [Qemu-devel] [RFC PATCH V3 1/4] colo-compare: introduce colo compare initlization

2016-05-11 Thread Zhang Chen
On 05/09/2016 06:49 PM, Zhang Chen wrote: + +s->chr_sec_in = qemu_chr_find(s->sec_indev); +if (s->chr_sec_in == NULL) { +error_setg(errp, "Secondary IN Device '%s' not found", + s->sec_indev); +return; +} + +

<    1   2   3   4   5   6   7   8   9   10   >