On Thu, Jul 04, 2019 at 04:26:29PM +0200, Peter Krempa wrote:
To allow using -blockdev with blockjobs need to reopen files in
read-write mode when modifying the backing chain.
-EPARSE
s/blockjobs need/blockjobs QEMU needs/
To achieve this we
need to use 'auto-read-only' for the backing files rather than the
normal 'read-only' property. That way qemu knows that the files need to
be reopened.
Note that the format drivers (e.g. qcow2) are still opened with the
read-only property enabled when being a member of the backing chain
since they are supposed to be immutable unless a block job is started.
QEMU v4.0 allows also dynamic behaviour for auto-read-only which allows
us to use sVirt as we only grant write permissions to files when doing
a blockjob.
commit 23dece19da41724349809873923e20a48b619cb7
file-posix: Make auto-read-only dynamic
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_block.c | 26 ++++++++++++++++---
src/qemu/qemu_block.h | 6 +++--
[...]
.../qemu-ns.x86_64-latest.args | 2 +-
39 files changed, 115 insertions(+), 92 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index c9e6af49c9..9abdac5ca3 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1027,6 +1027,7 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSourcePtr
src,
* @src: disk source
* @legacy: use legacy formatting of attributes (for -drive / old qemus)
* @onlytarget: omit any data which does not identify the image itself
+ * @autoreadonly: Use the new auto-readonly feature in qemu
I'd rather avoid use of the word 'new'. Just copy the other wording
which also spells the feature name correctly:
@autoreadonly: use 'auto-read-only' feature of qemu
*
* Creates a JSON object describing the underlying storage or protocol of a
* storage source. Returns NULL on error and reports an appropriate error message.
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano