From patchwork Thu Jan 26 06:36:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 9538373 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 BD5C7604A0 for ; Thu, 26 Jan 2017 06:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAD2E1FF35 for ; Thu, 26 Jan 2017 06:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E10B205AF; Thu, 26 Jan 2017 06:41:26 +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 8E1CD1FF35 for ; Thu, 26 Jan 2017 06:41:25 +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 1cWdgk-0007PT-Nf; Thu, 26 Jan 2017 06:37:42 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWdgj-0007P9-Ii for xen-devel@lists.xenproject.org; Thu, 26 Jan 2017 06:37:41 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 3D/F8-29440-43999885; Thu, 26 Jan 2017 06:37:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRWlGSWpSXmKPExsViPb2gRddoZme EwYuH/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bBm++ZC3qPMVa8/XmKuYHxfidjFyMnh4SA n0TDhavMILaQQK3E7q8NrF2MXED2SkaJ3g0f2CASuxglmvZzgNhsAgYSc65MBGsWESiXuHZ9L RNIA7PASUaJTVNXsYMkhAUCJJqn7QSzWQRUJXa3PQAaxMHBK+AjMX2tKsRiOYmb5zrBFnMK+E os2z6bBWKXj8SaRefB9vIKCEqcnPkELM4sICFx8MULZpAxEgKKEm3XeCHG6Eo8mzqNBcLWlNi 2+hwbRImVxNStnhBhQYmdzy+wTWAUmYVk6CwkQxcwMq1i1ChOLSpLLdI1MtNLKspMzyjJTczM 0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAgMcwYg2MF4ZkHgIUZJDiYlUd6b2p0RQnxJ+SmVGYnFG fFFpTmpxYcYZTg4lCR4n0wHygkWpaanVqRl5gAjDiYtwcGjJML7HyTNW1yQmFucmQ6ROsWoKC XO2wiSEABJZJTmwbXBovwSo6yUMC8j0CFCPAWpRbmZJajyrxjFORiVhHkPgkzhycwrgZv+Cmg xE9DiC8ztIItLEhFSUg2Mi+4v/KduGsYr3Diz0Dcpab7XiaJJl9Pemz1haDhwVyjMa/KVFzy2 K7ZGfLEVMXELF0mxjrziHH+l4F4k989V6RPqb6innnmy0OvRnZOaUa/ntawrX7DsdbksZ+//E o5Dxy0fPFoeusTcd9OWuyzMf14mbVYV1GPkulT/4X7cnbWVwWt3T7WJVmIpzkg01GIuKk4EAP TsjOvtAgAA X-Env-Sender: zhangchen.fnst@cn.fujitsu.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1485412654!83482877!1 X-Originating-IP: [59.151.112.132] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55685 invoked from network); 26 Jan 2017 06:37:36 -0000 Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by server-16.tower-27.messagelabs.com with SMTP; 26 Jan 2017 06:37:36 -0000 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="15111292" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 Jan 2017 14:37:34 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 706DA47B1502; Thu, 26 Jan 2017 14:37:34 +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; Thu, 26 Jan 2017 14:37:34 +0800 From: Zhang Chen To: Xen devel , Ian Jackson , Wei Liu Date: Thu, 26 Jan 2017 14:36:07 +0800 Message-ID: <1485412569-7431-5-git-send-email-zhangchen.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485412569-7431-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> References: <1485412569-7431-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.56] X-yoursite-MailScanner-ID: 706DA47B1502.AD85A X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhangchen.fnst@cn.fujitsu.com Cc: "eddie . dong" , Yang Hongyang , Bian Naimeng , Li Zhijian , Zhang Chen Subject: [Xen-devel] [PATCH RFC 4/6] COLO-Proxy: Add primary 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 --- tools/libxl/libxl_dm.c | 104 ++++++++++++++++++++ tools/libxl/libxl_nic.c | 232 ++++++++++++++++++++++++++++++++++++++++++++ tools/libxl/libxl_types.idl | 31 +++++- tools/libxl/xl_cmdimpl.c | 58 +++++++++++ 4 files changed, 424 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 281058d..b3484df 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1244,6 +1244,110 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, nics[i].devid, ifname, libxl_tapif_script(gc), libxl_tapif_script(gc))); + + /* Userspace COLO Proxy need this */ + if (state->saved_state) { + /* secondary colo run */ + } else { + /* primary colo run */ + if (nics[i].sock_mirror_id && + nics[i].sock_mirror_ip && + nics[i].sock_mirror_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s,server,nowait", + nics[i].sock_mirror_id, + nics[i].sock_mirror_ip, + nics[i].sock_mirror_port)); + } + if (nics[i].sock_compare_pri_in_id && + nics[i].sock_compare_pri_in_ip && + nics[i].sock_compare_pri_in_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s,server,nowait", + nics[i].sock_compare_pri_in_id, + nics[i].sock_compare_pri_in_ip, + nics[i].sock_compare_pri_in_port)); + } + if (nics[i].sock_compare_sec_in_id && + nics[i].sock_compare_sec_in_ip && + nics[i].sock_compare_sec_in_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s,server,nowait", + nics[i].sock_compare_sec_in_id, + nics[i].sock_compare_sec_in_ip, + nics[i].sock_compare_sec_in_port)); + } + if (nics[i].sock_redirector0_id && + nics[i].sock_redirector0_ip && + nics[i].sock_redirector0_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s,server,nowait", + nics[i].sock_redirector0_id, + nics[i].sock_redirector0_ip, + nics[i].sock_redirector0_port)); + } + if (nics[i].sock_redirector1_id && + nics[i].sock_redirector1_ip && + nics[i].sock_redirector1_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s", + nics[i].sock_redirector1_id, + nics[i].sock_redirector1_ip, + nics[i].sock_redirector1_port)); + } + if (nics[i].sock_redirector2_id && + nics[i].sock_redirector2_ip && + nics[i].sock_redirector2_port) { + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=%s,host=%s,port=%s", + nics[i].sock_redirector2_id, + nics[i].sock_redirector2_ip, + nics[i].sock_redirector2_port)); + } + if (nics[i].filter_mirror_queue && + nics[i].filter_mirror_outdev) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-mirror,id=m1,netdev=net%d,queue=%s,outdev=%s", + nics[i].devid, + nics[i].filter_mirror_queue, + nics[i].filter_mirror_outdev)); + } + if (nics[i].filter_redirector0_queue && + nics[i].filter_redirector0_indev) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-redirector,id=r1,netdev=net%d,queue=%s,indev=%s", + nics[i].devid, + nics[i].filter_redirector0_queue, + nics[i].filter_redirector0_indev)); + } + if (nics[i].filter_redirector1_queue && + nics[i].filter_redirector1_outdev) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("filter-redirector,id=r2,netdev=net%d,queue=%s,outdev=%s", + nics[i].devid, + nics[i].filter_redirector1_queue, + nics[i].filter_redirector1_outdev)); + } + if (nics[i].colo_compare_pri_in && + nics[i].colo_compare_sec_in && + nics[i].colo_compare_out) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("colo-compare,id=c1,primary_in=%s,secondary_in=%s,outdev=%s", + nics[i].colo_compare_pri_in, + nics[i].colo_compare_sec_in, + nics[i].colo_compare_out)); + } + } ioemu_nics++; } } diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c index 61b55ca..b7a3596 100644 --- a/tools/libxl/libxl_nic.c +++ b/tools/libxl/libxl_nic.c @@ -196,6 +196,123 @@ static void libxl__device_nic_add(libxl__egc *egc, uint32_t domid, flexarray_append(back, nic->coloft_forwarddev); } + if (nic->sock_mirror_id) { + flexarray_append(back, "sock_mirror_id"); + flexarray_append(back, nic->sock_mirror_id); + } + if (nic->sock_mirror_ip) { + flexarray_append(back, "sock_mirror_ip"); + flexarray_append(back, nic->sock_mirror_ip); + } + if (nic->sock_mirror_port) { + flexarray_append(back, "sock_mirror_port"); + flexarray_append(back, nic->sock_mirror_port); + } + if (nic->sock_compare_pri_in_id) { + flexarray_append(back, "sock_compare_pri_in_id"); + flexarray_append(back, nic->sock_compare_pri_in_id); + } + if (nic->sock_compare_pri_in_ip) { + flexarray_append(back, "sock_compare_pri_in_ip"); + flexarray_append(back, nic->sock_compare_pri_in_ip); + } + if (nic->sock_compare_pri_in_port) { + flexarray_append(back, "sock_compare_pri_in_port"); + flexarray_append(back, nic->sock_compare_pri_in_port); + } + if (nic->sock_compare_sec_in_id) { + flexarray_append(back, "sock_compare_sec_in_id"); + flexarray_append(back, nic->sock_compare_sec_in_id); + } + if (nic->sock_compare_sec_in_ip) { + flexarray_append(back, "sock_compare_sec_in_ip"); + flexarray_append(back, nic->sock_compare_sec_in_ip); + } + if (nic->sock_compare_sec_in_port) { + flexarray_append(back, "sock_compare_sec_in_port"); + flexarray_append(back, nic->sock_compare_sec_in_port); + } + if (nic->sock_redirector0_id) { + flexarray_append(back, "sock_redirector0_id"); + flexarray_append(back, nic->sock_redirector0_id); + } + if (nic->sock_redirector0_ip) { + flexarray_append(back, "sock_redirector0_ip"); + flexarray_append(back, nic->sock_redirector0_ip); + } + if (nic->sock_redirector0_port) { + flexarray_append(back, "sock_redirector0_port"); + flexarray_append(back, nic->sock_redirector0_port); + } + if (nic->sock_redirector1_id) { + flexarray_append(back, "sock_redirector1_id"); + flexarray_append(back, nic->sock_redirector1_id); + } + if (nic->sock_redirector1_ip) { + flexarray_append(back, "sock_redirector1_ip"); + flexarray_append(back, nic->sock_redirector1_ip); + } + if (nic->sock_redirector1_port) { + flexarray_append(back, "sock_redirector1_port"); + flexarray_append(back, nic->sock_redirector1_port); + } + if (nic->sock_redirector2_id) { + flexarray_append(back, "sock_redirector2_id"); + flexarray_append(back, nic->sock_redirector2_id); + } + if (nic->sock_redirector2_ip) { + flexarray_append(back, "sock_redirector2_ip"); + flexarray_append(back, nic->sock_redirector2_ip); + } + if (nic->sock_redirector2_port) { + flexarray_append(back, "sock_redirector2_port"); + flexarray_append(back, nic->sock_redirector2_port); + } + if (nic->filter_mirror_queue) { + flexarray_append(back, "filter_mirror_queue"); + flexarray_append(back, nic->filter_mirror_queue); + } + if (nic->filter_mirror_outdev) { + flexarray_append(back, "filter_mirror_outdev"); + flexarray_append(back, nic->filter_mirror_outdev); + } + if (nic->filter_redirector0_queue) { + flexarray_append(back, "filter_redirector0_queue"); + flexarray_append(back, nic->filter_redirector0_queue); + } + if (nic->filter_redirector0_indev) { + flexarray_append(back, "filter_redirector0_indev"); + flexarray_append(back, nic->filter_redirector0_indev); + } + if (nic->filter_redirector0_outdev) { + flexarray_append(back, "filter_redirector0_outdev"); + flexarray_append(back, nic->filter_redirector0_outdev); + } + if (nic->filter_redirector1_queue) { + flexarray_append(back, "filter_redirector1_queue"); + flexarray_append(back, nic->filter_redirector1_queue); + } + if (nic->filter_redirector1_indev) { + flexarray_append(back, "filter_redirector1_indev"); + flexarray_append(back, nic->filter_redirector1_indev); + } + if (nic->filter_redirector1_outdev) { + flexarray_append(back, "filter_redirector1_outdev"); + flexarray_append(back, nic->filter_redirector1_outdev); + } + if (nic->colo_compare_pri_in) { + flexarray_append(back, "colo_compare_pri_in"); + flexarray_append(back, nic->colo_compare_pri_in); + } + if (nic->colo_compare_sec_in) { + flexarray_append(back, "colo_compare_sec_in"); + flexarray_append(back, nic->colo_compare_sec_in); + } + if (nic->colo_compare_out) { + flexarray_append(back, "colo_compare_out"); + flexarray_append(back, nic->colo_compare_out); + } + flexarray_append(back, "mac"); flexarray_append(back,GCSPRINTF(LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac))); if (nic->ip) { @@ -348,6 +465,121 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc, GCSPRINTF("%s/forwarddev", libxl_path), (const char **)(&nic->coloft_forwarddev)); if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_mirror_id", libxl_path), + (const char **)(&nic->sock_mirror_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_mirror_ip", libxl_path), + (const char **)(&nic->sock_mirror_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_mirror_port", libxl_path), + (const char **)(&nic->sock_mirror_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_pri_in_id", libxl_path), + (const char **)(&nic->sock_compare_pri_in_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_pri_in_ip", libxl_path), + (const char **)(&nic->sock_compare_pri_in_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_pri_in_port", libxl_path), + (const char **)(&nic->sock_compare_pri_in_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_sec_in_id", libxl_path), + (const char **)(&nic->sock_compare_sec_in_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_sec_in_ip", libxl_path), + (const char **)(&nic->sock_compare_sec_in_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_compare_sec_in_port", libxl_path), + (const char **)(&nic->sock_compare_sec_in_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector0_id", libxl_path), + (const char **)(&nic->sock_redirector0_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector0_ip", libxl_path), + (const char **)(&nic->sock_redirector0_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector0_port", libxl_path), + (const char **)(&nic->sock_redirector0_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector1_id", libxl_path), + (const char **)(&nic->sock_redirector1_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector1_ip", libxl_path), + (const char **)(&nic->sock_redirector1_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector1_port", libxl_path), + (const char **)(&nic->sock_redirector1_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector2_id", libxl_path), + (const char **)(&nic->sock_redirector2_id)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector2_ip", libxl_path), + (const char **)(&nic->sock_redirector2_ip)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/sock_redirector2_port", libxl_path), + (const char **)(&nic->sock_redirector2_port)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_mirror_queue", libxl_path), + (const char **)(&nic->filter_mirror_queue)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_mirror_outdev", libxl_path), + (const char **)(&nic->filter_mirror_outdev)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector0_queue", libxl_path), + (const char **)(&nic->filter_redirector0_queue)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector0_indev", libxl_path), + (const char **)(&nic->filter_redirector0_indev)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector0_outdev", libxl_path), + (const char **)(&nic->filter_redirector0_outdev)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector1_queue", libxl_path), + (const char **)(&nic->filter_redirector1_queue)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector1_indev", libxl_path), + (const char **)(&nic->filter_redirector1_indev)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/filter_redirector1_outdev", libxl_path), + (const char **)(&nic->filter_redirector1_outdev)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/colo_compare_pri_in", libxl_path), + (const char **)(&nic->colo_compare_pri_in)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/colo_compare_sec_in", libxl_path), + (const char **)(&nic->colo_compare_sec_in)); + if (rc) goto out; + rc = libxl__xs_read_checked(NOGC, XBT_NULL, + GCSPRINTF("%s/colo_compare_out", libxl_path), + (const char **)(&nic->colo_compare_out)); /* vif_ioemu nics use the same xenstore entries as vif interfaces */ rc = libxl__xs_read_checked(gc, XBT_NULL, diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 89c2c9d..1deb11b 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -629,7 +629,36 @@ libxl_device_nic = Struct("device_nic", [ ("gatewaydev", string), # Note that the COLO configuration settings should be considered unstable. # They may change incompatibly in future versions of Xen. - ("coloft_forwarddev", string) + ("coloft_forwarddev", string), + ("sock_mirror_id", string), + ("sock_mirror_ip", string), + ("sock_mirror_port", string), + ("sock_compare_pri_in_id", string), + ("sock_compare_pri_in_ip", string), + ("sock_compare_pri_in_port", string), + ("sock_compare_sec_in_id", string), + ("sock_compare_sec_in_ip", string), + ("sock_compare_sec_in_port", string), + ("sock_redirector0_id", string), + ("sock_redirector0_ip", string), + ("sock_redirector0_port", string), + ("sock_redirector1_id", string), + ("sock_redirector1_ip", string), + ("sock_redirector1_port", string), + ("sock_redirector2_id", string), + ("sock_redirector2_ip", string), + ("sock_redirector2_port", string), + ("filter_mirror_queue", string), + ("filter_mirror_outdev", string), + ("filter_redirector0_queue", string), + ("filter_redirector0_indev", string), + ("filter_redirector0_outdev", string), + ("filter_redirector1_queue", string), + ("filter_redirector1_indev", string), + ("filter_redirector1_outdev", string), + ("colo_compare_pri_in", string), + ("colo_compare_sec_in", string), + ("colo_compare_out", string) ]) libxl_device_pci = Struct("device_pci", [ diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 1620bd7..996316e 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1060,6 +1060,64 @@ static int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *to parse_vif_rate(config, oparg, nic); } else if (MATCH_OPTION("forwarddev", token, oparg)) { replace_string(&nic->coloft_forwarddev, oparg); + } else if (MATCH_OPTION("sock_mirror_id", token, oparg)) { + replace_string(&nic->sock_mirror_id, oparg); + } else if (MATCH_OPTION("sock_mirror_ip", token, oparg)) { + replace_string(&nic->sock_mirror_ip, oparg); + } else if (MATCH_OPTION("sock_mirror_port", token, oparg)) { + replace_string(&nic->sock_mirror_port, oparg); + } else if (MATCH_OPTION("sock_compare_sec_in_id", token, oparg)) { + replace_string(&nic->sock_compare_sec_in_id, oparg); + } else if (MATCH_OPTION("sock_compare_sec_in_ip", token, oparg)) { + replace_string(&nic->sock_compare_sec_in_ip, oparg); + } else if (MATCH_OPTION("sock_compare_sec_in_port", token, oparg)) { + replace_string(&nic->sock_compare_sec_in_port, oparg); + } else if (MATCH_OPTION("sock_redirector0_id", token, oparg)) { + replace_string(&nic->sock_redirector0_id, oparg); + } else if (MATCH_OPTION("sock_redirector0_ip", token, oparg)) { + replace_string(&nic->sock_redirector0_ip, oparg); + } else if (MATCH_OPTION("sock_redirector0_port", token, oparg)) { + replace_string(&nic->sock_redirector0_port, oparg); + } else if (MATCH_OPTION("sock_redirector1_id", token, oparg)) { + replace_string(&nic->sock_redirector1_id, oparg); + } else if (MATCH_OPTION("sock_redirector1_ip", token, oparg)) { + replace_string(&nic->sock_redirector1_ip, oparg); + } else if (MATCH_OPTION("sock_redirector1_port", token, oparg)) { + replace_string(&nic->sock_redirector1_port, oparg); + } else if (MATCH_OPTION("sock_redirector2_id", token, oparg)) { + replace_string(&nic->sock_redirector2_id, oparg); + } else if (MATCH_OPTION("sock_redirector2_ip", token, oparg)) { + replace_string(&nic->sock_redirector2_ip, oparg); + } else if (MATCH_OPTION("sock_redirector2_port", token, oparg)) { + replace_string(&nic->sock_redirector2_port, oparg); + } else if (MATCH_OPTION("sock_compare_pri_in_id", token, oparg)) { + replace_string(&nic->sock_compare_pri_in_id, oparg); + } else if (MATCH_OPTION("sock_compare_pri_in_ip", token, oparg)) { + replace_string(&nic->sock_compare_pri_in_ip, oparg); + } else if (MATCH_OPTION("sock_compare_pri_in_port", token, oparg)) { + replace_string(&nic->sock_compare_pri_in_port, oparg); + } else if (MATCH_OPTION("filter_mirror_queue", token, oparg)) { + replace_string(&nic->filter_mirror_queue, oparg); + } else if (MATCH_OPTION("filter_mirror_outdev", token, oparg)) { + replace_string(&nic->filter_mirror_outdev, oparg); + } else if (MATCH_OPTION("filter_redirector0_queue", token, oparg)) { + replace_string(&nic->filter_redirector0_queue, oparg); + } else if (MATCH_OPTION("filter_redirector0_indev", token, oparg)) { + replace_string(&nic->filter_redirector0_indev, oparg); + } else if (MATCH_OPTION("filter_redirector0_outdev", token, oparg)) { + replace_string(&nic->filter_redirector0_outdev, oparg); + } else if (MATCH_OPTION("filter_redirector1_queue", token, oparg)) { + replace_string(&nic->filter_redirector1_queue, oparg); + } else if (MATCH_OPTION("filter_redirector1_indev", token, oparg)) { + replace_string(&nic->filter_redirector1_indev, oparg); + } else if (MATCH_OPTION("filter_redirector1_outdev", token, oparg)) { + replace_string(&nic->filter_redirector1_outdev, oparg); + } else if (MATCH_OPTION("colo_compare_pri_in", token, oparg)) { + replace_string(&nic->colo_compare_pri_in, oparg); + } else if (MATCH_OPTION("colo_compare_sec_in", token, oparg)) { + 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("accel", token, oparg)) { fprintf(stderr, "the accel parameter for vifs is currently not supported\n"); } else {