mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-23 05:50:03 +03:00
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:
committed by
Cole Robinson
parent
9bb6e4e739
commit
b4e34d1083
@ -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");
|
||||
|
11
tests/xml2vmxdata/xml2vmx-firmware-efi.vmx
Normal file
11
tests/xml2vmxdata/xml2vmx-firmware-efi.vmx
Normal 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"
|
8
tests/xml2vmxdata/xml2vmx-firmware-efi.xml
Normal file
8
tests/xml2vmxdata/xml2vmx-firmware-efi.xml
Normal 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>
|
@ -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);
|
||||
|
Reference in New Issue
Block a user