Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1624009 - allow backing of pflash via -blockdev
Summary: allow backing of pflash via -blockdev
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: CongLi
Depends On:
Blocks: 1436245 1686552 1605127
TreeView+ depends on / blocked
Reported: 2018-08-30 16:24 UTC by Peter Krempa
Modified: 2019-03-20 17:33 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1686552 (view as bug list)
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

Description Peter Krempa 2018-08-30 16:24:27 UTC
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.

Comment 2 Markus Armbruster 2018-09-26 09:03:48 UTC
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.

Comment 3 Markus Armbruster 2019-03-13 13:26:31 UTC
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 \
-machine pflash0=pflash0,pflash1=pflash1

Comment 4 Markus Armbruster 2019-03-20 16:27:38 UTC
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 \
    -drive if=pflash,format=raw,unit=1,file=copy-of-OVMF_VARS.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 \
    -machine pflash0=pflash0,pflash1=pflash1

Backport has quite a few patches, but most of them apply cleanly or with only trivial conflicts.

Note You need to log in before you can comment on or make changes to this bug.