From nobody Sun Feb 8 15:28:38 2026 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 --- 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