From nobody Fri May 3 09:41:34 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1554818699; cv=none; d=zoho.com; s=zohoarc; b=ahg7FdCWBk73E9bICwnN2sNLY9qnVwFK2xyOFoLSYFwks/2/KnWGspqv7L2vbuQP7jzEw3bh0fRKom+HcwYS5d6UmWdJcpNVAar2encE8/56Xv1s2RmqtHdHHif2tezsdtUz499fgNk52BpAMgUgtH/x+QeT0Sk2sxmA2v/oQos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554818699; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tJnf0RmypDKHol8ejNuJAKPQepTCH8elMXNdcpKT1rA=; b=InE3QoP07Yvr/f+BOsQnmmR7gPcL08qotyiXgndcOe2aMm3KQ/eQiVsJrjKp01jnWb7kdR+awxnZv9WMwMDLE2v6ZF68T9dUrelRpAnsZeuXGi+UOqSw/iNIVmTqfXKBWDm/ejUANCBNmn2naU2KTiArjtdkwx70uD6rTJClGlk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554818699165400.12313169556694; Tue, 9 Apr 2019 07:04:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E46E8AE4D; Tue, 9 Apr 2019 14:04:46 +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 539F91001E6B; Tue, 9 Apr 2019 14:04:45 +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 9CC9B41F3D; Tue, 9 Apr 2019 14:04:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39E4eRD020046 for ; Tue, 9 Apr 2019 10:04:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 154E31A267; Tue, 9 Apr 2019 14:04:40 +0000 (UTC) Received: from thyrus.usersys.redhat.com (unknown [10.34.244.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EFE21975E for ; Tue, 9 Apr 2019 14:04:39 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:04:31 +0200 Message-Id: <20190409140433.20423-2-ptoscano@redhat.com> In-Reply-To: <20190409140433.20423-1-ptoscano@redhat.com> References: <20190409140433.20423-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] vmx: convert firmware config for autoselection 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-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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 09 Apr 2019 14:04:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Convert the firmware key to a type of autoselected firmware. Only the 'efi' firmware is allowed for now, in case the key is present. It seems VMware (at least ESXi) does not write the key in VMX files when setting BIOS as firmware. Signed-off-by: Pino Toscano Reviewed-by: Cole Robinson --- src/vmx/vmx.c | 16 ++++++++++++++++ tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 3 +++ tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 18 ++++++++++++++++++ tests/vmx2xmltest.c | 2 ++ 4 files changed, 39 insertions(+) create mode 100644 tests/vmx2xmldata/vmx2xml-firmware-efi.vmx create mode 100644 tests/vmx2xmldata/vmx2xml-firmware-efi.xml diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index ae9ee87be3..3842991bab 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1304,6 +1304,7 @@ virVMXParseConfig(virVMXContext *ctx, struct virVMXConfigScanResults results =3D { -1 }; long long coresPerSocket =3D 0; virCPUDefPtr cpu =3D NULL; + char *firmware =3D NULL; =20 if (ctx->parseFileName =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1826,6 +1827,21 @@ virVMXParseConfig(virVMXContext *ctx, def->namespaceData =3D nsdata; } =20 + /* vmx:firmware */ + if (virVMXGetConfigString(conf, "firmware", &firmware, true) < 0) + goto cleanup; + + if (firmware !=3D NULL) { + if (STREQ(firmware, "efi")) { + def->os.firmware =3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI; + } else { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("VMX entry 'firmware' has unknown value '%s'"= ), + firmware); + goto cleanup; + } + } + if (virDomainDefPostParse(def, caps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, xmlopt, NULL) < 0) goto cleanup; diff --git a/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx b/tests/vmx2xmldata= /vmx2xml-firmware-efi.vmx new file mode 100644 index 0000000000..dbb215a5db --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx @@ -0,0 +1,3 @@ +config.version =3D "8" +virtualHW.version =3D "13" +firmware =3D "efi" diff --git a/tests/vmx2xmldata/vmx2xml-firmware-efi.xml b/tests/vmx2xmldata= /vmx2xml-firmware-efi.xml new file mode 100644 index 0000000000..e21158cebf --- /dev/null +++ b/tests/vmx2xmldata/vmx2xml-firmware-efi.xml @@ -0,0 +1,18 @@ + + 00000000-0000-0000-0000-000000000000 + 32768 + 32768 + 1 + + hvm + + + destroy + restart + destroy + + + + diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index b70e8191d1..d7d03f1753 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -285,6 +285,8 @@ mymain(void) =20 DO_TEST("svga", "svga"); =20 + DO_TEST("firmware-efi", "firmware-efi"); + ctx.datacenterPath =3D "folder1/folder2/datacenter1"; =20 DO_TEST("datacenterpath", "datacenterpath"); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 09:41:34 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1554818708; cv=none; d=zoho.com; s=zohoarc; b=FGoUAjfaQSeR+4BVefa4ttfoDC3MW/Qu2/oVkJ3L8sAHjFz8e2z4s4sYxuJUyeZrv6KXx+jaAshoK9NVdUAY8zULpIZ9nSsS8uv8TJL/Bgyv6o0X1gxufK0uQW1gKZDxQa/WGT0+IWA3UUk7Yh1tFgoizjCBDc5j2YYg1+j5CxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554818708; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gWCuXlp26Ey7t2+5bseC82DgjQva1X4tfPSNfFDPkco=; b=jy0dOQOXRWmZcdHMbh+j3Vr8dz+7eCDsxmToR5Z0mtadjm0h2BR9mlEYdmB8yZVJXu4bL/MS2mFRVJ4EMc3npwzvrPE3VMYXSDhAV9Ho688ZsYspwIThLL6EuvJxPoyQQvgSUqKgZqIZVMIkRQfIbXORhxLjThNtQy3TlSIV0eE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554818708342677.4282854375712; Tue, 9 Apr 2019 07:05:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 566F4307ACE6; Tue, 9 Apr 2019 14:05:04 +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 1C86F17AC7; Tue, 9 Apr 2019 14:05:03 +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 AAA0F3FB12; Tue, 9 Apr 2019 14:05:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39E4ebd020053 for ; Tue, 9 Apr 2019 10:04:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5D5A1975E; Tue, 9 Apr 2019 14:04:40 +0000 (UTC) Received: from thyrus.usersys.redhat.com (unknown [10.34.244.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 678DC45BC for ; Tue, 9 Apr 2019 14:04:40 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:04:32 +0200 Message-Id: <20190409140433.20423-3-ptoscano@redhat.com> In-Reply-To: <20190409140433.20423-1-ptoscano@redhat.com> References: <20190409140433.20423-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] vmx: write firmware back from autoselection 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 09 Apr 2019 14:05:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When writing the VMX file from the domain XML, write the firmware key according to the firmware autoselection. Though, at the moment only 'efi' is supported. Signed-off-by: Pino Toscano Reviewed-by: Cole Robinson --- src/vmx/vmx.c | 4 ++++ tests/xml2vmxdata/xml2vmx-firmware-efi.vmx | 11 +++++++++++ tests/xml2vmxdata/xml2vmx-firmware-efi.xml | 8 ++++++++ tests/xml2vmxtest.c | 2 ++ 4 files changed, 25 insertions(+) create mode 100644 tests/xml2vmxdata/xml2vmx-firmware-efi.vmx create mode 100644 tests/xml2vmxdata/xml2vmx-firmware-efi.xml diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 3842991bab..f5d7bffb57 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -3408,6 +3408,10 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLO= ptionPtr xmlopt, virDomainDe goto cleanup; } =20 + /* vmx:firmware */ + if (def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) + virBufferAddLit(&buffer, "firmware =3D \"efi\"\n"); + if (virtualHW_version >=3D 7) { if (hasSCSI) { virBufferAddLit(&buffer, "pciBridge0.present =3D \"true\"\n"); diff --git a/tests/xml2vmxdata/xml2vmx-firmware-efi.vmx b/tests/xml2vmxdata= /xml2vmx-firmware-efi.vmx new file mode 100644 index 0000000000..cc3ec9f34b --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-firmware-efi.vmx @@ -0,0 +1,11 @@ +.encoding =3D "UTF-8" +config.version =3D "8" +virtualHW.version =3D "4" +guestOS =3D "other" +uuid.bios =3D "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15" +displayName =3D "firmware-efi" +memsize =3D "4" +numvcpus =3D "1" +floppy0.present =3D "false" +floppy1.present =3D "false" +firmware =3D "efi" diff --git a/tests/xml2vmxdata/xml2vmx-firmware-efi.xml b/tests/xml2vmxdata= /xml2vmx-firmware-efi.xml new file mode 100644 index 0000000000..b91735ab63 --- /dev/null +++ b/tests/xml2vmxdata/xml2vmx-firmware-efi.xml @@ -0,0 +1,8 @@ + + firmware-efi + 564d9bef-acd9-b4e0-c8f0-aea8b9103515 + 4096 + + hvm + + diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index 0143c05b19..5d5dc0a518 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -295,6 +295,8 @@ mymain(void) =20 DO_TEST("svga", "svga", 4); =20 + DO_TEST("firmware-efi", "firmware-efi", 4); + DO_TEST("datacenterpath", "datacenterpath", 4); =20 virObjectUnref(caps); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 09:41:34 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1554818714; cv=none; d=zoho.com; s=zohoarc; b=f3Nta8cj50rUClCio5uarhR8bfnTbdBGoHjEEaLoAw64N0mR6ESDMrUm32sJ12jx2IWQAVd/hSRGCBjNohMmoDTMd0TTWKTweqYgarrcmvDZRV6WwtFjyrk5/rhRI+2esjUJ67EY72qvS+YsBJKIIPp0FW8R2HuVH7V2twAWsGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554818714; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=F7dvMk5+7gJvyhNYob8rCOnAxAhQqpezurn8KX14+zY=; b=cR8HdRDYf8eeq0x9vZ3Oe0Rf/z25Ysve+LufWlblxzTdhbirAcPLC61drrR12CORSZeMVTsVJJw32gGLNd7JFKSf3kC/8ON7jTHLFW5hSzKUgAK3PFW/iUJ8QpuVduWEXSe105epPt86ojKuAJNMkn62ag2knAV/dzoUJjdZoAA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554818714090956.9875594100049; Tue, 9 Apr 2019 07:05:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A30C3308FEE2; Tue, 9 Apr 2019 14:05:11 +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 6427A5D960; Tue, 9 Apr 2019 14:05:11 +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 B175D3FB14; Tue, 9 Apr 2019 14:05:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39E4fSw020062 for ; Tue, 9 Apr 2019 10:04:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC6111A267; Tue, 9 Apr 2019 14:04:41 +0000 (UTC) Received: from thyrus.usersys.redhat.com (unknown [10.34.244.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41D5E18504 for ; Tue, 9 Apr 2019 14:04:41 +0000 (UTC) From: Pino Toscano To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:04:33 +0200 Message-Id: <20190409140433.20423-4-ptoscano@redhat.com> In-Reply-To: <20190409140433.20423-1-ptoscano@redhat.com> References: <20190409140433.20423-1-ptoscano@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] docs: document firmware attribute for VMware guests 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 09 Apr 2019 14:05:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pino Toscano Reviewed-by: Cole Robinson --- docs/formatdomain.html.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0e3799061d..3d84ae0fcb 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -159,7 +159,10 @@ For more information refer to firmware metadata specification as described in docs/interop/firmware.json in QEMU repository. Regular users do not need to bother. - Since 5.2.0 (QEMU and KVM only) + Since 5.2.0 (QEMU and KVM only)
+ For VMware guests, this is set to efi when the guest + uses UEFI, and it is not set when using BIOS. + Since 5.3.0 (VMware ESX and Workstation/Play= er)
type
The content of the type element specifies the --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list