mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-03 14:38:31 +00:00
fix efi disk format detection
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 2bfbee039b
("include format for efidisk")
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
3618ee99aa
commit
13bca7b4de
@ -2908,20 +2908,27 @@ sub config_to_command {
|
|||||||
die "uefi base image not found\n" if ! -f $OVMF_CODE;
|
die "uefi base image not found\n" if ! -f $OVMF_CODE;
|
||||||
|
|
||||||
my $path;
|
my $path;
|
||||||
my $format = 'raw';
|
my $format;
|
||||||
if (my $efidisk = $conf->{efidisk0}) {
|
if (my $efidisk = $conf->{efidisk0}) {
|
||||||
my $d = PVE::JSONSchema::parse_property_string($efidisk_fmt, $efidisk);
|
my $d = PVE::JSONSchema::parse_property_string($efidisk_fmt, $efidisk);
|
||||||
my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
|
my ($storeid, $volname) = PVE::Storage::parse_volume_id($d->{file}, 1);
|
||||||
|
$format = $d->{format};
|
||||||
if ($storeid) {
|
if ($storeid) {
|
||||||
$path = PVE::Storage::path($storecfg, $d->{file});
|
$path = PVE::Storage::path($storecfg, $d->{file});
|
||||||
|
if (!defined($format)) {
|
||||||
|
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
||||||
|
$format = qemu_img_format($scfg, $volname);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$path = $d->{file};
|
$path = $d->{file};
|
||||||
|
die "efidisk format must be specified\n"
|
||||||
|
if !defined($format);
|
||||||
}
|
}
|
||||||
$format = $d->{format} if $d->{format};
|
|
||||||
} else {
|
} else {
|
||||||
warn "no efidisk configured! Using temporary efivars disk.\n";
|
warn "no efidisk configured! Using temporary efivars disk.\n";
|
||||||
$path = "/tmp/$vmid-ovmf.fd";
|
$path = "/tmp/$vmid-ovmf.fd";
|
||||||
PVE::Tools::file_copy($OVMF_VARS, $path, -s $OVMF_VARS);
|
PVE::Tools::file_copy($OVMF_VARS, $path, -s $OVMF_VARS);
|
||||||
|
$format = 'raw';
|
||||||
}
|
}
|
||||||
|
|
||||||
push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$OVMF_CODE";
|
push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly,file=$OVMF_CODE";
|
||||||
|
Loading…
Reference in New Issue
Block a user