vmx: write firmware back from autoselection

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.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2019-04-09 16:04:32 +02:00 committed by Cole Robinson
parent 9bb6e4e739
commit b4e34d1083
4 changed files with 25 additions and 0 deletions

View File

@ -3409,6 +3409,10 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
goto cleanup;
}
/* vmx:firmware */
if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)
virBufferAddLit(&buffer, "firmware = \"efi\"\n");
if (virtualHW_version >= 7) {
if (hasSCSI) {
virBufferAddLit(&buffer, "pciBridge0.present = \"true\"\n");

View File

@ -0,0 +1,11 @@
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "4"
guestOS = "other"
uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
displayName = "firmware-efi"
memsize = "4"
numvcpus = "1"
floppy0.present = "false"
floppy1.present = "false"
firmware = "efi"

View File

@ -0,0 +1,8 @@
<domain type='vmware'>
<name>firmware-efi</name>
<uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
<memory unit='KiB'>4096</memory>
<os firmware='efi'>
<type>hvm</type>
</os>
</domain>

View File

@ -295,6 +295,8 @@ mymain(void)
DO_TEST("svga", "svga", 4);
DO_TEST("firmware-efi", "firmware-efi", 4);
DO_TEST("datacenterpath", "datacenterpath", 4);
virObjectUnref(caps);