Description of problem:
The 'pflash' device is instantiated by definig the -drive which is backing it. To allow snapshotting it along with the disks it would be beneficial to allow using -blockdev for it so that the same code can be reused.
We configure pflash devices with -drive if=pflash,... Peter is looking for a way to configure them with -blockdev and -device. I'll look into it.
Upstream merge commit eda1df0345f5a1e337e30367124dcb0e802bdfde provides -machine properties pflash0 and pflash1. Use like this:
-blockdev node-name=pflash0,driver=file,read-only=on,filename=OVMF_CODE.fd \
-blockdev node-name=pflash1,driver=raw,filename=OVMF_VARS.fd \
Fixed in upstream merge commit eda1df0345f5a1e337e30367124dcb0e802bdfde, will be in QEMU v4.0.
The fix supersedes the old way of configuring OVMF
-drive if=pflash,format=raw,unit=0,readonly,file=/usr/share/edk2/ovmf/OVMF_CODE.fd \
-blockdev node-name=pflash0,driver=file,read-only=on,filename=/usr/share/edk2/ovmf/OVMF_CODE.fd \
-blockdev node-name=pflash1,driver=file,filename=copy-of-OVMF_VARS.fd \
Backport has quite a few patches, but most of them apply cleanly or with only trivial conflicts.
Fix included in qemu-kvm-rhev-2.12.0-29.el7
Verified on qemu-kvm-rhev-2.12.0-29.el7.x86_64.
pflash works well with blockdev.
-blockdev node-name=pflash0,read-only=on,driver=file,filename=/usr/share/OVMF/OVMF_CODE.secboot.fd \
-blockdev node-name=pflash1,driver=file,filename=/home/kvm_autotest_root/images/rhel77-64-virtio-scsi.qcow2.fd \
-machine pflash0=pflash0,pflash1=pflash1 \
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.