From patchwork Tue Dec 22 10:42:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 560009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38D00140BB7 for ; Tue, 22 Dec 2015 23:41:54 +1100 (AEDT) Received: from localhost ([::1]:50043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBMGG-0001U8-3d for incoming@patchwork.ozlabs.org; Tue, 22 Dec 2015 07:41:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBMDh-0005EC-LA for qemu-devel@nongnu.org; Tue, 22 Dec 2015 07:39:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBMDg-00005v-24 for qemu-devel@nongnu.org; Tue, 22 Dec 2015 07:39:13 -0500 Received: from [59.151.112.132] (port=13328 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBMDf-00005d-LK for qemu-devel@nongnu.org; Tue, 22 Dec 2015 07:39:11 -0500 X-IronPort-AV: E=Sophos;i="5.20,346,1444665600"; d="scan'208";a="1856272" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Dec 2015 18:43:04 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id C0675409256D; Tue, 22 Dec 2015 18:42:45 +0800 (CST) Received: from G08FNSTD140215.g08.fujitsu.local (10.167.226.56) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 22 Dec 2015 18:42:45 +0800 From: Zhang Chen To: qemu devel , Jason Wang , Stefan Hajnoczi Date: Tue, 22 Dec 2015 18:42:49 +0800 Message-ID: <1450780978-19123-2-git-send-email-zhangchen.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450780978-19123-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> References: <1450780978-19123-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.56] X-yoursite-MailScanner-ID: C0675409256D.AD90D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhangchen.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: Li Zhijian , Gui jianfeng , "eddie.dong" , "Dr. David Alan Gilbert" , Huang peng , Gong lei , jan.kiszka@siemens.com, Zhang Chen , Yang Hongyang , zhanghailiang Subject: [Qemu-devel] [RFC PATCH v2 01/10] Init colo-proxy object based on netfilter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: zhangchen add colo-proxy to vl.c and qemu-options.hx add trace-colo-proxy relation Signed-off-by: zhangchen Signed-off-by: zhanghailiang --- qemu-options.hx | 6 ++++++ trace-events | 8 ++++++++ vl.c | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 0eea4ee..6daa3f0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3670,6 +3670,12 @@ queue @var{all|rx|tx} is an option that can be applied to any netfilter. @option{tx}: the filter is attached to the transmit queue of the netdev, where it will receive packets sent by the netdev. +@item -object colo-proxy,id=@var{id},netdev=@var{netdevid},addr=@var{host:port},mode=@var{primary|secondary}[,queue=@var{all}] + +Colo-proxy on netdev @var{netdevid},set colo mode @var{primary|secondary} +connect other colo through addr@var{host:port},and colo needs queue all +packet arriving in queue=@var{all} + @item -object filter-dump,id=@var{id},netdev=@var{dev},file=@var{filename}][,maxlen=@var{len}] Dump the network traffic on netdev @var{dev} to the file specified by diff --git a/trace-events b/trace-events index 5f95b3c..a957fb3 100644 --- a/trace-events +++ b/trace-events @@ -1586,6 +1586,14 @@ colo_failover_set_state(int new_state) "new state %d" colo_start_block_replication(void) "Block replication is started" colo_stop_block_replication(const char *reason) "Block replication is stopped(reason: '%s')" +# net/colo-proxy.c +colo_proxy(const char *sta) ": %s" +colo_proxy_with_ret(const char *sta, ssize_t ret) ": %s ret = %zu" +colo_proxy_packet_src(const char *src) ":ipsrc = %s" +colo_proxy_packet_dst(const char *dst) ":ipdst = %s" +colo_proxy_packet_size(int size) ": %d" +colo_proxy_queue_size(int size) ": %d" + # kvm-all.c kvm_ioctl(int type, void *arg) "type 0x%x, arg %p" kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p" diff --git a/vl.c b/vl.c index 8dc34ce..dcfb3a9 100644 --- a/vl.c +++ b/vl.c @@ -2838,7 +2838,8 @@ static bool object_create_initial(const char *type) * they depend on netdevs already existing */ if (g_str_equal(type, "filter-buffer") || - g_str_equal(type, "filter-dump")) { + g_str_equal(type, "filter-dump") || + g_str_equal(type, "colo-proxy")) { return false; }