From patchwork Mon Mar 6 02:59:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 9605009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B47AB601D2 for ; Mon, 6 Mar 2017 03:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81D5126E81 for ; Mon, 6 Mar 2017 03:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 766E827D5D; Mon, 6 Mar 2017 03:03:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DFE6826E81 for ; Mon, 6 Mar 2017 03:03:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckitJ-0006Z6-NB; Mon, 06 Mar 2017 03:00:53 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckitI-0006YM-9m for xen-devel@lists.xenproject.org; Mon, 06 Mar 2017 03:00:52 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id C4/BD-32461-3E0DCB85; Mon, 06 Mar 2017 03:00:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRWlGSWpSXmKPExsViPb2gRffRhT0 RBk+bjC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozjnyUL7jpVdL69yNTAONuki5GTQ0LAT2LL viXMILaQQK3Ei6eNQDYXkL2SUaL/1GIWCGcno8SxozPBqtgEDCTmXJnI2MXIwSEiUC5xe4U4S JhZ4BujxPSX2SC2sECgxMrmxewgNouAisSvSyfBWnkFfCUmN71hg1gsJ3HzXCdYnBPoiItnrj JBHOErMfvmdiaIekGJkzOfsEDMl5A4+OIFM8haCQFFibZrvBBjdCW2XprBBGFrSmxbfY4NosR KYupWT4iwoMTO5xfYJjCKzEIydBaSoQsYmVYxahSnFpWlFukameslFWWmZ5TkJmbm6BoamOrl phYXJ6an5iQmFesl5+duYgQGeD0DA+MOxqtb/A4xSnIwKYnyHirYGSHEl5SfUpmRWJwRX1Sak 1p8iFGGg0NJgndlB1BOsCg1PbUiLTMHGGswaQkOHiUR3ukgad7igsTc4sx0iNQpRl2OObN3v2 ESYsnLz0uVEuctBSkSACnKKM2DGwGL+0uMslLCvIwMDAxCPAWpRbmZJajyrxjFORiVhHmXg0z hycwrgdv0CugIJqAj/GTAjihJREhJNTA2TF60v9v1cNjCx8+it1tntjvXfLukFyt85kYTz4pr agy3hJgLi5qyN/HV/y+wfhYyw6r5QNHh+Hk3LzyNVo6+YO21QYGJQX5t5tcpwnXnbU+enJJgP lP9YF2w/V0lSe072dt6nOdzqYhUO/D8dpois6vA4RTH8bwoG5ZVOvNY9322Sd1pe1uJpTgj0V CLuag4EQBiGzB99gIAAA== X-Env-Sender: zhangchen.fnst@cn.fujitsu.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1488769245!87768884!3 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24905 invoked from network); 6 Mar 2017 03:00:49 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-8.tower-206.messagelabs.com with SMTP; 6 Mar 2017 03:00:49 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="16226302" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 06 Mar 2017 11:00:41 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id A7D0247D8B7B; Mon, 6 Mar 2017 11:00:41 +0800 (CST) Received: from localhost.localdomain (10.167.226.56) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 6 Mar 2017 11:00:43 +0800 From: Zhang Chen To: Xen devel , Wei Liu , Ian Jackson Date: Mon, 6 Mar 2017 10:59:23 +0800 Message-ID: <1488769166-28738-6-git-send-email-zhangchen.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488769166-28738-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> References: <1488769166-28738-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.56] X-yoursite-MailScanner-ID: A7D0247D8B7B.A0DC9 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhangchen.fnst@cn.fujitsu.com Cc: Zhang Chen , Li Zhijian , eddie dong , Yang Hongyang , Bian Naimeng Subject: [Xen-devel] [PATCH V4 5/8] COLO-Proxy: Add secondary userspace colo-proxy start args X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Qemu need this args to start userspace colo-proxy. Signed-off-by: Zhang Chen Acked-by: Wei Liu --- tools/libxl/libxl_dm.c | 34 ++++++++++++++++++++++++++++++++++ tools/libxl/libxl_nic.c | 27 +++++++++++++++++++++++++++ tools/libxl/libxl_types.idl | 15 ++++++++++++++- tools/xl/xl_parse.c | 27 +++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index abd4edd..0fabd64 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1274,6 +1274,40 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, if (state->saved_state) { /* secondary colo run */ + + APPEND_COLO_SOCK_CLIENT(sock_sec_redirector0_id, + sock_sec_redirector0_ip, + sock_sec_redirector0_port); + + APPEND_COLO_SOCK_CLIENT(sock_sec_redirector1_id, + sock_sec_redirector1_ip, + sock_sec_redirector1_port); + + if (nics[i].colo_filter_sec_redirector0_queue && + nics[i].colo_filter_sec_redirector0_indev) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-redirector,id=rs1,netdev=net%d,queue=%s,indev=%s", + nics[i].devid, + nics[i].colo_filter_sec_redirector0_queue, + nics[i].colo_filter_sec_redirector0_indev)); + } + if (nics[i].colo_filter_sec_redirector1_queue && + nics[i].colo_filter_sec_redirector1_indev) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-redirector,id=rs2,netdev=net%d,queue=%s,outdev=%s", + nics[i].devid, + nics[i].colo_filter_sec_redirector1_queue, + nics[i].colo_filter_sec_redirector1_outdev)); + } + if (nics[i].colo_filter_sec_rewriter0_queue) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-rewriter,id=rs3,netdev=net%d,queue=%s", + nics[i].devid, + nics[i].colo_filter_sec_rewriter0_queue)); + } } else { /* primary colo run */ diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c index 7c57bcf..5e1fecd 100644 --- a/tools/libxl/libxl_nic.c +++ b/tools/libxl/libxl_nic.c @@ -233,6 +233,20 @@ static void libxl__device_nic_add(libxl__egc *egc, uint32_t domid, MAYBE_ADD_COLO_ARGS(compare_sec_in); MAYBE_ADD_COLO_ARGS(compare_out); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_id); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_ip); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector0_port); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_id); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_ip); + MAYBE_ADD_COLO_ARGS(sock_sec_redirector1_port); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_queue); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_indev); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector0_outdev); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_queue); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_indev); + MAYBE_ADD_COLO_ARGS(filter_sec_redirector1_outdev); + MAYBE_ADD_COLO_ARGS(filter_sec_rewriter0_queue); + #undef MAYBE_ADD_COLO_ARGS flexarray_append(back, "mac"); @@ -424,6 +438,19 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc, CHECK_COLO_ARGS(compare_pri_in); CHECK_COLO_ARGS(compare_sec_in); CHECK_COLO_ARGS(compare_out); + CHECK_COLO_ARGS(sock_sec_redirector0_id); + CHECK_COLO_ARGS(sock_sec_redirector0_ip); + CHECK_COLO_ARGS(sock_sec_redirector0_port); + CHECK_COLO_ARGS(sock_sec_redirector1_id); + CHECK_COLO_ARGS(sock_sec_redirector1_ip); + CHECK_COLO_ARGS(sock_sec_redirector1_port); + CHECK_COLO_ARGS(filter_sec_redirector0_queue); + CHECK_COLO_ARGS(filter_sec_redirector0_indev); + CHECK_COLO_ARGS(filter_sec_redirector0_outdev); + CHECK_COLO_ARGS(filter_sec_redirector1_queue); + CHECK_COLO_ARGS(filter_sec_redirector1_indev); + CHECK_COLO_ARGS(filter_sec_redirector1_outdev); + CHECK_COLO_ARGS(filter_sec_rewriter0_queue); #undef CHECK_COLO_ARGS diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 07ce345..47e96b1 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -658,7 +658,20 @@ libxl_device_nic = Struct("device_nic", [ ("colo_filter_redirector1_outdev", string), ("colo_compare_pri_in", string), ("colo_compare_sec_in", string), - ("colo_compare_out", string) + ("colo_compare_out", string), + ("colo_sock_sec_redirector0_id", string), + ("colo_sock_sec_redirector0_ip", string), + ("colo_sock_sec_redirector0_port", string), + ("colo_sock_sec_redirector1_id", string), + ("colo_sock_sec_redirector1_ip", string), + ("colo_sock_sec_redirector1_port", string), + ("colo_filter_sec_redirector0_queue", string), + ("colo_filter_sec_redirector0_indev", string), + ("colo_filter_sec_redirector0_outdev", string), + ("colo_filter_sec_redirector1_queue", string), + ("colo_filter_sec_redirector1_indev", string), + ("colo_filter_sec_redirector1_outdev", string), + ("colo_filter_sec_rewriter0_queue", string) ]) libxl_device_pci = Struct("device_pci", [ diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 88ef1c6..d2bbe26 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -516,6 +516,33 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token) replace_string(&nic->colo_compare_sec_in, oparg); } else if (MATCH_OPTION("colo_compare_out", token, oparg)) { replace_string(&nic->colo_compare_out, oparg); + + } else if (MATCH_OPTION("colo_sock_sec_redirector0_id", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector0_id, oparg); + } else if (MATCH_OPTION("colo_sock_sec_redirector0_ip", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector0_ip, oparg); + } else if (MATCH_OPTION("colo_sock_sec_redirector0_port", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector0_port, oparg); + } else if (MATCH_OPTION("colo_sock_sec_redirector1_id", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector1_id, oparg); + } else if (MATCH_OPTION("colo_sock_sec_redirector1_ip", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector1_ip, oparg); + } else if (MATCH_OPTION("colo_sock_sec_redirector1_port", token, oparg)) { + replace_string(&nic->colo_sock_sec_redirector1_port, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector0_queue", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector0_queue, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector0_indev", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector0_indev, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector0_outdev", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector0_outdev, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector1_queue", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector1_queue, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector1_indev", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector1_indev, oparg); + } else if (MATCH_OPTION("colo_filter_sec_redirector1_outdev", token, oparg)) { + replace_string(&nic->colo_filter_sec_redirector1_outdev, oparg); + } else if (MATCH_OPTION("colo_filter_sec_rewriter0_queue", token, oparg)) { + replace_string(&nic->colo_filter_sec_rewriter0_queue, oparg); } else if (MATCH_OPTION("accel", token, oparg)) { fprintf(stderr, "the accel parameter for vifs is currently not supported\n"); } else if (MATCH_OPTION("devid", token, oparg)) {