[pve-devel] [PATCH qemu-server v2] fix efidisks on storages with minimum sizes bigger than OVMF_VARS.fd

Stefan Reiter s.reiter at proxmox.com
Tue Feb 18 15:23:17 CET 2020

On 2/12/20 1:31 PM, Dominik Csapak wrote:
> 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 at proxmox.com>
> ---
> changes from v1:
> * rebase on master (drop PVE version increase; drop test adaptions)
> * use version_guard instead of min_version
> * add tests for raw efidisk

Patch looks good, and after discussing off-list I'm convinced this is 
indeed the best way to fix the issue.

Tested-by: Stefan Reiter <s.reiter at proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter at proxmox.com>

More information about the pve-devel mailing list