]> git.proxmox.com Git - qemu-server.git/commitdiff
include format for efidisk
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 7 Nov 2017 07:18:56 +0000 (08:18 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 7 Nov 2017 07:45:25 +0000 (08:45 +0100)
if the efidisk is in 'raw' format, qemu will prevent writes
on block zero if the format is not explicitely given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/QemuServer.pm

index 896089fbf20def19b5f06273531b6d89765a987f..0ebe6e93cb784ab3d07553e6dbe8c9f89424a682 100644 (file)
@@ -2901,6 +2901,7 @@ sub config_to_command {
        die "uefi base image not found\n" if ! -f $OVMF_CODE;
 
        my $path;
+       my $format = 'raw';
        if (my $efidisk = $conf->{efidisk0}) {
            my $d = PVE::JSONSchema::parse_property_string($efidisk_fmt, $efidisk);
            my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
@@ -2909,6 +2910,7 @@ sub config_to_command {
            } else {
                $path = $d->{file};
            }
+           $format = $d->{format} if $d->{format};
        } else {
            warn "no efidisk configured! Using temporary efivars disk.\n";
            $path = "/tmp/$vmid-ovmf.fd";
@@ -2916,7 +2918,7 @@ sub config_to_command {
        }
 
        push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$OVMF_CODE";
-       push @$cmd, '-drive', "if=pflash,unit=1,id=drive-efidisk0,file=$path";
+       push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0,file=$path";
     }