提交 3460fef5 编写于 作者: P Peter Krempa

qemu: caps: Add capability for dynamic 'auto-read-only' support for files

Initial implementation of 'auto-read-only' didn't reopen the backing
files when needed. For '-blockdev' to work we need to be able to tel
qemu to open a file read-only and change it during blockjobs as we label
backing chains with a sVirt label which does not allow writing. The
dynamic auto-read-only supports this as it reopens files when writing
is demanded.

Add a capability to detect that the posix file based backends support
the dynamic part.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 73445e49
...@@ -550,6 +550,7 @@ VIR_ENUM_IMPL(virQEMUCaps, ...@@ -550,6 +550,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 345 */ /* 345 */
"arm-max-cpu", "arm-max-cpu",
"blockdev-file-dynamic-auto-read-only",
); );
...@@ -1395,6 +1396,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { ...@@ -1395,6 +1396,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
{ "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS_EGL_HEADLESS_RENDERNODE }, { "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS_EGL_HEADLESS_RENDERNODE },
{ "nbd-server-add/arg-type/bitmap", QEMU_CAPS_NBD_BITMAP }, { "nbd-server-add/arg-type/bitmap", QEMU_CAPS_NBD_BITMAP },
{ "blockdev-add/arg-type/+file/drop-cache", QEMU_CAPS_MIGRATION_FILE_DROP_CACHE }, { "blockdev-add/arg-type/+file/drop-cache", QEMU_CAPS_MIGRATION_FILE_DROP_CACHE },
{ "blockdev-add/arg-type/+file/$dynamic-auto-read-only", QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC },
}; };
typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
......
...@@ -531,6 +531,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ ...@@ -531,6 +531,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 345 */ /* 345 */
QEMU_CAPS_ARM_MAX_CPU, /* max-arm-cpu type exists */ QEMU_CAPS_ARM_MAX_CPU, /* max-arm-cpu type exists */
QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC, /* the auto-read-only property of block backends for files is dynamic */
QEMU_CAPS_LAST /* this must always be the last item */ QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags; } virQEMUCapsFlags;
......
...@@ -212,6 +212,7 @@ ...@@ -212,6 +212,7 @@
<flag name='vhost-user-gpu'/> <flag name='vhost-user-gpu'/>
<flag name='vhost-user-vga'/> <flag name='vhost-user-vga'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='blockdev-file-dynamic-auto-read-only'/>
<version>4001000</version> <version>4001000</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100241</microcodeVersion> <microcodeVersion>43100241</microcodeVersion>
......
...@@ -170,6 +170,7 @@ ...@@ -170,6 +170,7 @@
<flag name='vhost-user-gpu'/> <flag name='vhost-user-gpu'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='arm-max-cpu'/> <flag name='arm-max-cpu'/>
<flag name='blockdev-file-dynamic-auto-read-only'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>61700242</microcodeVersion> <microcodeVersion>61700242</microcodeVersion>
......
...@@ -173,6 +173,7 @@ ...@@ -173,6 +173,7 @@
<flag name='vhost-user-gpu'/> <flag name='vhost-user-gpu'/>
<flag name='vhost-user-vga'/> <flag name='vhost-user-vga'/>
<flag name='machine.pseries.cap-ccf-assist'/> <flag name='machine.pseries.cap-ccf-assist'/>
<flag name='blockdev-file-dynamic-auto-read-only'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>42900242</microcodeVersion> <microcodeVersion>42900242</microcodeVersion>
......
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
<flag name='vhost-user-gpu'/> <flag name='vhost-user-gpu'/>
<flag name='query-cpu-model-baseline'/> <flag name='query-cpu-model-baseline'/>
<flag name='query-cpu-model-comparison'/> <flag name='query-cpu-model-comparison'/>
<flag name='blockdev-file-dynamic-auto-read-only'/>
<version>4001050</version> <version>4001050</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>39100242</microcodeVersion> <microcodeVersion>39100242</microcodeVersion>
......
...@@ -213,6 +213,7 @@ ...@@ -213,6 +213,7 @@
<flag name='vhost-user-gpu'/> <flag name='vhost-user-gpu'/>
<flag name='vhost-user-vga'/> <flag name='vhost-user-vga'/>
<flag name='ramfb'/> <flag name='ramfb'/>
<flag name='blockdev-file-dynamic-auto-read-only'/>
<version>4001092</version> <version>4001092</version>
<kvmVersion>0</kvmVersion> <kvmVersion>0</kvmVersion>
<microcodeVersion>43100242</microcodeVersion> <microcodeVersion>43100242</microcodeVersion>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册