From patchwork Fri Jul 26 06:43:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 11060401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8471A112C for ; Fri, 26 Jul 2019 06:50:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708A428A22 for ; Fri, 26 Jul 2019 06:50:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60E8828A4F; Fri, 26 Jul 2019 06:50:32 +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=0.2 required=2.0 tests=BAYES_00,FROM_ADDR_WS, FROM_WSP_TRAIL,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=no version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BF7228A22 for ; Fri, 26 Jul 2019 06:50:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqu1p-0004tj-6l; Fri, 26 Jul 2019 06:48:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqu1n-0004te-Nr for xen-devel@lists.xenproject.org; Fri, 26 Jul 2019 06:48:31 +0000 X-Inumbo-ID: 60645d5e-af71-11e9-808a-dbaa9afa509b Received: from mga11.intel.com (unknown [192.55.52.93]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 60645d5e-af71-11e9-808a-dbaa9afa509b; Fri, 26 Jul 2019 06:48:30 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 23:48:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,309,1559545200"; d="scan'208";a="175510243" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga006.jf.intel.com with ESMTP; 25 Jul 2019 23:48:27 -0700 From: Zhang Chen To: Ian Jackson , Wei Liu , Anthony PERARD , xen-devel@lists.xenproject.org Date: Fri, 26 Jul 2019 14:43:00 +0800 Message-Id: <20190726064300.27530-1-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.GIT Subject: [Xen-devel] [PATCH V2] tools/libxl: Add iothread support for COLO X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Zhang Chen MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Zhang Chen Xen COLO and KVM COLO shared lots of code in Qemu. KVM COLO has added the iothread support, so we add it on Xen. Detail: https://wiki.qemu.org/Features/COLO Signed-off-by: Zhang Chen --- tools/libxl/libxl_dm.c | 14 +++++++++++--- tools/libxl/libxl_types.idl | 1 + tools/xl/xl_parse.c | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f4fc96415d..95cb30f9e6 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1629,17 +1629,25 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, nics[i].colo_filter_redirector1_queue, nics[i].colo_filter_redirector1_outdev)); } + if (nics[i].colo_iothread) { + flexarray_append(dm_args, "-object"); + flexarray_append(dm_args, + GCSPRINTF("iothread,id=%s", + nics[i].colo_iothread)); + } if (nics[i].colo_compare_pri_in && nics[i].colo_compare_sec_in && nics[i].colo_compare_out && - nics[i].colo_compare_notify_dev) { + nics[i].colo_compare_notify_dev && + nics[i].colo_iothread) { flexarray_append(dm_args, "-object"); flexarray_append(dm_args, - GCSPRINTF("colo-compare,id=c1,primary_in=%s,secondary_in=%s,outdev=%s,notify_dev=%s", + GCSPRINTF("colo-compare,id=c1,primary_in=%s,secondary_in=%s,outdev=%s,notify_dev=%s,iothread=%s", nics[i].colo_compare_pri_in, nics[i].colo_compare_sec_in, nics[i].colo_compare_out, - nics[i].colo_compare_notify_dev)); + nics[i].colo_compare_notify_dev, + nics[i].colo_iothread)); } } ioemu_nics++; diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index b61399ce36..eda958eb4b 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -727,6 +727,7 @@ libxl_device_nic = Struct("device_nic", [ ("colo_filter_redirector1_queue", string), ("colo_filter_redirector1_indev", string), ("colo_filter_redirector1_outdev", string), + ("colo_iothread", string), ("colo_compare_pri_in", string), ("colo_compare_sec_in", string), ("colo_compare_out", string), diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index e105bda2bb..0b8189f375 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -521,6 +521,8 @@ int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char *token) replace_string(&nic->colo_filter_redirector1_indev, oparg); } else if (MATCH_OPTION("colo_filter_redirector1_outdev", token, oparg)) { replace_string(&nic->colo_filter_redirector1_outdev, oparg); + } else if (MATCH_OPTION("colo_iothread", token, oparg)) { + replace_string(&nic->colo_iothread, 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)) {