]> git.proxmox.com Git - qemu-server.git/commit
fix efidisks on storages with minimum sizes bigger than OVMF_VARS.fd
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 12 Feb 2020 12:31:06 +0000 (13:31 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 30 Mar 2020 07:41:55 +0000 (09:41 +0200)
commit818ce80ec1a89c4abee61145c858b9323180e31b
treedbc2d89fb8d8461a077fcd241e12a65565c39462
parent5c50a84f23b594415a6984854c165aebe3d8c3df
fix efidisks on storages with minimum sizes bigger than OVMF_VARS.fd

on storages where the minimum size of images is bigger than the real
OVMF_VARS.fd file, they get padded to their minimum size

when using such an image, qemu maps it fully to the vm, but the efi
does not find the vars region and creates a file on the first efi
partition it finds

this breaks some settings in the ovmf, such as resolution

to fix this, we have to specify the size for the pflash, so that
qemu only maps the first n bytes in the vm (this only works for
raw files, not for qcow2)

we also have to use the correct size when converting between storages
in 'clone_disk' (used for move disk and cloning vms) and when
live migrating to different storages

when we now expect that the source image is always correctly used/created
(e.g. raw with size=x in pflash argument) then we always create the
target correctly

when encountering users which have a non-valid image (e.g. a efidisk
moved from zfs to qcow2 before this patch), we have to tell them to
recreate the efidisk and the settings on it

we have to version_guard it to 4.1+pve2 (since we haven't bumped yet
since the change to pve2)

also add 2 tests, one for the old version and one for the new

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
[ Thomas: rebased to master ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuMigrate.pm
PVE/QemuServer.pm
test/cfg2cmd/efi-raw-old.conf [new file with mode: 0644]
test/cfg2cmd/efi-raw-old.conf.cmd [new file with mode: 0644]
test/cfg2cmd/efi-raw.conf [new file with mode: 0644]
test/cfg2cmd/efi-raw.conf.cmd [new file with mode: 0644]