Revision e35bdc123a4ace9f4d3fccaaf88907014e2438cd authored by Kevin Wolf on 05 October 2018, 16:57:40 UTC, committed by Kevin Wolf on 05 November 2018, 14:09:55 UTC
If a management application builds the block graph node by node, the protocol layer doesn't inherit its read-only option from the format layer any more, so it must be set explicitly. Backing files should work on read-only storage, but at the same time, a block job like commit should be able to reopen them read-write if they are on read-write storage. However, without option inheritance, reopen only changes the read-only option for the root node (typically the format layer), but not the protocol layer, so reopening fails (the format layer wants to get write permissions, but the protocol layer is still read-only). A simple workaround for the problem in the management tool would be to open the protocol layer always read-write and to make only the format layer read-only for backing files. However, sometimes the file is actually stored on read-only storage and we don't know whether the image can be opened read-write (for example, for NBD it depends on the server we're trying to connect to). This adds an option that makes QEMU try to open the image read-write, but allows it to degrade to a read-only mode without returning an error. The documentation for this option is consciously phrased in a way that allows QEMU to switch to a better model eventually: Instead of trying when the image is first opened, making the read-only flag dynamic and changing it automatically whenever the first BLK_PERM_WRITE user is attached or the last one is detached would be much more useful behaviour. Unfortunately, this more useful behaviour is also a lot harder to implement, and libvirt needs a solution now before it can switch to -blockdev, so let's start with this easier approach for now. Instead of adding a new auto-read-only option, turning the existing read-only into an enum (with a bool alternate for compatibility) was considered, but it complicated the implementation to the point that it didn't seem to be worth it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
1 parent eeae6a5
File | Mode | Size |
---|---|---|
QemuMacDrivers @ d4e7d7a | ||
SLOF @ 9b7ab2f | ||
ipxe @ 0600d3a | ||
openbios @ 441a84d | ||
openhackware @ c559da7 | ||
qemu-palcode @ f3c7e44 | ||
seabios @ f9626cc | ||
seabios-hppa @ 1ef99a0 | ||
sgabios @ cbaee52 | ||
skiboot @ e0ee24c | ||
u-boot @ d85ca02 | ||
u-boot-sam460ex @ 60b3916 | ||
Makefile | -rw-r--r-- | 5.5 KB |
config.seabios-128k | -rw-r--r-- | 354 bytes |
config.seabios-256k | -rw-r--r-- | 88 bytes |
config.vga-bochs-display | -rw-r--r-- | 63 bytes |
config.vga-cirrus | -rw-r--r-- | 60 bytes |
config.vga-isavga | -rw-r--r-- | 59 bytes |
config.vga-qxl | -rw-r--r-- | 128 bytes |
config.vga-ramfb | -rw-r--r-- | 59 bytes |
config.vga-stdvga | -rw-r--r-- | 59 bytes |
config.vga-virtio | -rw-r--r-- | 128 bytes |
config.vga-vmware | -rw-r--r-- | 128 bytes |
configure-seabios.sh | -rwxr-xr-x | 111 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...