]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix formatting of pflash readonly attribute
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 7 Feb 2022 12:10:28 +0000 (12:10 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 8 Feb 2022 13:04:20 +0000 (13:04 +0000)
commit3ef9b51b10e52886e8fe8d75e36d0714957616b7
tree7cb0454519e5512af31270e564efd967181c2e84
parent7904e521b2625fbdf6401f12e962b9c0b364ccda
qemu: fix formatting of pflash readonly attribute

When the <loader> had an explicit readonly='no' attribute we
accidentally still marked the plfash as readonly due to the
bad conversion from virTristateBool to bool. This was missed
because the test cases run with no capabilities set and thus
are validated the -drive approach for pflash configuration,
not the -blockdev approach.

This affected the following config:

  <os>
    <loader readonly='no' type='pflash'>/var/lib/libvirt/qemu/nvram/test-bios.fd</loader>
  </os>

for the sake of completeness, we also add a test XML config
with no readonly attribute at all, to demonstrate that the
default for pflash is intended to be r/w.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/bios-nvram-rw-implicit.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/bios-nvram-rw-implicit.xml [new file with mode: 0644]
tests/qemuxml2argvdata/bios-nvram-rw.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/bios-nvram-rw.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c