From nobody Sat Jul 27 02:58:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538926800899485.98705068299864; Sun, 7 Oct 2018 08:40:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B86AC309706E; Sun, 7 Oct 2018 15:39:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79AFF429C7; Sun, 7 Oct 2018 15:39:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 345334CAAD; Sun, 7 Oct 2018 15:39:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w97FdbFF000584 for ; Sun, 7 Oct 2018 11:39:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB91960910; Sun, 7 Oct 2018 15:39:37 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1A9E6090B for ; Sun, 7 Oct 2018 15:39:36 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 217BD30E6842 for ; Sun, 7 Oct 2018 15:39:35 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7BF0921BD9; Sun, 7 Oct 2018 11:39:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 07 Oct 2018 11:39:34 -0400 Received: from localhost.localdomain (ip5b409b0b.dynamic.kabel-deutschland.de [91.64.155.11]) by mail.messagingengine.com (Postfix) with ESMTPA id C34A7102D7; Sun, 7 Oct 2018 11:39:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:in-reply-to:message-id:mime-version :references:references:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=dNCXTg2tpS04BDScx 14WSO9UR/792JSlsEYTeimt600=; b=Z9HDt4KiOMr3u7hHhVVfz5xrrH2GREXIT ChlPOkmTY/Syyo26ebQcIaR/S6ChFu2tT38npyWPCmun4qyASr8kwnPmRm5fbIih 0Jp+TKq/2nVeon/avsOrvGm1CBQEJn54vtzZgQCo90Q9Mxz+I+RecOm6LBzKgpt7 KvPH6YlbGH5KAGiOdtzPj7h0Yz72Lyui7Dqh40KSo7xWxli4Bm+jnYG6F7nUeGK1 ti2VJm9lDc0fc8sswLajc/tQqNEqTaOe5H64w3sQid/zOp7DbyfhQeQ1+4dUyuZN 5XdkrfpR/WBO5TgdRNwmc0P2TqAK1dO/1OcbEpvlOXBAQYrhN7LLw== X-ME-Sender: X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: libvir-list@redhat.com Date: Sun, 7 Oct 2018 17:39:18 +0200 Message-Id: <679262dae0f5330a07e118efbf2f08e01d4a29bb.1538926535.git-series.marmarek@invisiblethingslab.com> In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sun, 07 Oct 2018 15:39:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sun, 07 Oct 2018 15:39:35 +0000 (UTC) for IP:'66.111.4.27' DOMAIN:'out3-smtp.messagingengine.com' HELO:'out3-smtp.messagingengine.com' FROM:'marmarek@invisiblethingslab.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS) 66.111.4.27 out3-smtp.messagingengine.com 66.111.4.27 out3-smtp.messagingengine.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 5/5] xenconfig: add support for type="pvh" X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sun, 07 Oct 2018 15:39:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Handle PVH domain type in both directions (xen-xl->xml, xml->xen-xl). And add a test for it. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- Changes in v3: - update for modified "libxl: add support for PVH" --- src/xenconfig/xen_common.c | 11 +++++++++-- src/xenconfig/xen_xl.c | 5 +++++ tests/testutilsxen.c | 3 ++- tests/xlconfigdata/test-pvh-type.cfg | 13 +++++++++++++ tests/xlconfigdata/test-pvh-type.xml | 25 +++++++++++++++++++++++++ tests/xlconfigtest.c | 1 + 6 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 tests/xlconfigdata/test-pvh-type.cfg create mode 100644 tests/xlconfigdata/test-pvh-type.xml diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index 6c27936..30b1c9f 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -1091,6 +1091,7 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr = def, virCapsPtr caps) virCapsDomainDataPtr capsdata =3D NULL; VIR_AUTOFREE(char *) str =3D NULL; int hvm =3D 0, ret =3D -1; + const char *machine =3D "xenpv"; =20 if (xenConfigCopyString(conf, "name", &def->name) < 0) goto out; @@ -1101,8 +1102,12 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr= def, virCapsPtr caps) if (xenConfigGetString(conf, "type", &str, NULL) =3D=3D 0 && str) { if (STREQ(str, "pv")) { hvm =3D 0; + } else if (STREQ(str, "pvh")) { + hvm =3D 0; + machine =3D "xenpvh"; } else if (STREQ(str, "hvm")) { hvm =3D 1; + machine =3D "xenfv"; } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("type %s is not supported"), str); @@ -1110,14 +1115,16 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPt= r def, virCapsPtr caps) } } else { if ((xenConfigGetString(conf, "builder", &str, "linux") =3D=3D 0) = && - STREQ(str, "hvm")) + STREQ(str, "hvm")) { hvm =3D 1; + machine =3D "xenfv"; + } } =20 def->os.type =3D (hvm ? VIR_DOMAIN_OSTYPE_HVM : VIR_DOMAIN_OSTYPE_XEN); =20 if (!(capsdata =3D virCapabilitiesDomainDataLookup(caps, def->os.type, - VIR_ARCH_NONE, def->virtType, NULL, NULL))) + VIR_ARCH_NONE, def->virtType, NULL, machine))) goto out; =20 def->os.arch =3D capsdata->arch; diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c index 7250e57..0df8f35 100644 --- a/src/xenconfig/xen_xl.c +++ b/src/xenconfig/xen_xl.c @@ -1287,6 +1287,11 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def) =20 /* XXX floppy disks */ } else { + if (STREQ(def->os.machine, "xenpvh")) { + if (xenConfigSetString(conf, "type", "pvh") < 0) + return -1; + } + if (def->os.bootloader && xenConfigSetString(conf, "bootloader", def->os.bootloader) < = 0) return -1; diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index d34be72..c112912 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -17,7 +17,8 @@ testXLInitCaps(void) "xenfv" }; static const char *const xen_machines[] =3D { - "xenpv" + "xenpv", + "xenpvh" }; =20 if ((caps =3D virCapabilitiesNew(virArchFromHost(), diff --git a/tests/xlconfigdata/test-pvh-type.cfg b/tests/xlconfigdata/test= -pvh-type.cfg new file mode 100644 index 0000000..2493535 --- /dev/null +++ b/tests/xlconfigdata/test-pvh-type.cfg @@ -0,0 +1,13 @@ +name =3D "XenGuest2" +uuid =3D "c7a5fdb2-cdaf-9455-926a-d65c16db1809" +maxmem =3D 579 +memory =3D 394 +vcpus =3D 1 +localtime =3D 0 +on_poweroff =3D "destroy" +on_reboot =3D "restart" +on_crash =3D "restart" +type =3D "pvh" +kernel =3D "/tmp/vmlinuz" +ramdisk =3D "/tmp/initrd" +cmdline =3D "root=3D/dev/xvda1 console=3Dhvc0" diff --git a/tests/xlconfigdata/test-pvh-type.xml b/tests/xlconfigdata/test= -pvh-type.xml new file mode 100644 index 0000000..7e3f182 --- /dev/null +++ b/tests/xlconfigdata/test-pvh-type.xml @@ -0,0 +1,25 @@ + + XenGuest2 + c7a5fdb2-cdaf-9455-926a-d65c16db1809 + 592896 + 403456 + 1 + + xen + /tmp/vmlinuz + /tmp/initrd + root=3D/dev/xvda1 console=3Dhvc0 + + + destroy + restart + restart + + + + + + + + + diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index 6e3267e..5159182 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -281,6 +281,7 @@ mymain(void) DO_TEST("rbd-multihost-noauth"); DO_TEST_FORMAT("paravirt-type", false); DO_TEST_FORMAT("fullvirt-type", false); + DO_TEST("pvh-type"); =20 #ifdef LIBXL_HAVE_DEVICE_CHANNEL DO_TEST("channel-pty"); --=20 git-series 0.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list