From patchwork Thu Sep 7 10:16:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9942077 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 495D0602B3 for ; Thu, 7 Sep 2017 10:19:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 506762862D for ; Thu, 7 Sep 2017 10:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4550D28633; Thu, 7 Sep 2017 10:19:24 +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 2A8FD2862D for ; Thu, 7 Sep 2017 10:19:23 +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 1dpts1-000568-Pq; Thu, 07 Sep 2017 10:17:13 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpts0-00055J-MZ for xen-devel@lists.xenproject.org; Thu, 07 Sep 2017 10:17:12 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id CC/29-03874-8AC11B95; Thu, 07 Sep 2017 10:17:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrLIsWRWlGSWpSXmKPExsXitHRDpO5ymY2 RBq8bRS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozTHzMK5olVLP98jrWB8YtgFyMHh4SAv8Sp 7+VdjJwcbAI6Ehfn7mQDCYsIqEjc3mvQxcjFwSywhlHi/Jw/7CA1wgI2EjcubWAGsVmAaq5/e 84KYvMKWEocvnCQCcSWENCTeDvxBSOIzSlgJTHl3X42EFsIqKat4SMjRL2gxMmZT1hAbGYBTY nW7b/ZIWx5ieats5kh6hUl+uc9YJvAyDcLScssJC2zkLQsYGRexahRnFpUllqka2iml1SUmZ5 RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGGgMQLCD8f7GgEOMkhxMSqK8l9XWRwrxJeWn VGYkFmfEF5XmpBYfYpTh4FCS4PWT3hgpJFiUmp5akZaZAwx5mLQEB4+SCO8/KaA0b3FBYm5xZ jpE6hSjMcexTZf/MHF03Lz7h0mIJS8/L1VKnFcQZJIASGlGaR7cIFgsXmKUlRLmZQQ6TYinIL UoN7MEVf4VozgHo5IwxBSezLwSuH2vgE5hAjql5PkGkFNKEhFSUg2My/bovhA48qJc8rRT8q/ Iu6d9dlw+8dYxViW0NKZ0NuPkrsfeGw/EXP4//6R5ppBDsZSrxqIZl+ZGNJf/Xr1u+46VJgrv NO8edv2msV370mSNz0dD84o+cr1Li/NqZzriEhJQbsgeav62vcnoxYMtjPefBymHcXg8u7Eg8 q/3OoEUNluZCPEMJZbijERDLeai4kQA9u84WcACAAA= X-Env-Sender: prvs=416136899=roger.pau@citrix.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1504779419!81636499!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34211 invoked from network); 7 Sep 2017 10:17:11 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 7 Sep 2017 10:17:11 -0000 X-IronPort-AV: E=Sophos;i="5.42,357,1500940800"; d="scan'208";a="438792505" From: Roger Pau Monne To: Date: Thu, 7 Sep 2017 11:16:25 +0100 Message-ID: <20170907101642.15782-5-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170907101642.15782-1-roger.pau@citrix.com> References: <20170907101642.15782-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Wei Liu , boris.ostrovsky@oracle.com, Roger Pau Monne , Ian Jackson Subject: [Xen-devel] [PATCH v2 04/21] xl: introduce a domain type option 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 Introduce a new type option to xl configuration files in order to specify the domain type. This supersedes the current builder option. The new option is documented in the xl.cfg man page, and the previous builder option is marked as deprecated. Signed-off-by: Roger Pau Monné Acked-by: Wei Liu Cc: Wei Liu --- docs/man/xl.cfg.pod.5.in | 22 ++++++++++++++++++++-- tools/xl/xl_parse.c | 20 +++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index 79cb2eaea7..ab53436da2 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -54,9 +54,9 @@ Pairs may be separated either by a newline or a semicolon. Both of the following are valid: name="h0" - builder="hvm" + type="hvm" - name="h0"; builder="hvm" + name="h0"; type="hvm" =head1 OPTIONS @@ -77,6 +77,24 @@ single host must be unique. =over 4 +=item B + +Specifies that this is to be a PV domain, suitable for hosting Xen-aware guest +operating systems. This is the default. + +=item B + +Specifies that this is to be an HVM domain. That is, a fully virtualised +computer with emulated BIOS, disk and network peripherals, etc. + +=back + +=head3 Deprecated guest type selection + +Note that the builder option is being deprecated in favor of the type option. + +=over 4 + =item B Specifies that this is to be a PV domain, suitable for hosting Xen-aware guest diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 61f9a38573..65297352bd 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -854,9 +854,23 @@ void parse_config_data(const char *config_source, libxl_defbool_set(&c_info->run_hotplug_scripts, run_hotplug_scripts); c_info->type = LIBXL_DOMAIN_TYPE_PV; - if (!xlu_cfg_get_string (config, "builder", &buf, 0) && - !strncmp(buf, "hvm", strlen(buf))) - c_info->type = LIBXL_DOMAIN_TYPE_HVM; + if (!xlu_cfg_get_string (config, "builder", &buf, 0)) { + fprintf(stderr, + "The builder option is being deprecated, please use type instead.\n"); + if (!strncmp(buf, "hvm", strlen(buf))) + c_info->type = LIBXL_DOMAIN_TYPE_HVM; + } + + if (!xlu_cfg_get_string (config, "type", &buf, 0)) { + if (!strncmp(buf, "hvm", strlen(buf))) { + c_info->type = LIBXL_DOMAIN_TYPE_HVM; + } else if (!strncmp(buf, "pv", strlen(buf))) { + c_info->type = LIBXL_DOMAIN_TYPE_PV; + } else { + fprintf(stderr, "Invalid domain type %s.\n", buf); + exit(1); + } + } xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);