]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: caps: Add capability for dynamic 'auto-read-only' support for files
authorPeter Krempa <pkrempa@redhat.com>
Mon, 8 Apr 2019 15:10:37 +0000 (17:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 22 Nov 2019 11:51:27 +0000 (12:51 +0100)
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: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml
tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml
tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml
tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml
tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml

index 356aed1a0e448fffe246fc5d30ea219f23aa909a..b5f6af8dff90fcd371db7faaf7e2496f9ca1abef 100644 (file)
@@ -550,6 +550,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
 
               /* 345 */
               "arm-max-cpu",
+              "blockdev-file-dynamic-auto-read-only",
     );
 
 
@@ -1395,6 +1396,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
     { "query-display-options/ret-type/+egl-headless/rendernode", QEMU_CAPS_EGL_HEADLESS_RENDERNODE },
     { "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/$dynamic-auto-read-only", QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC },
 };
 
 typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
index 23185341d3dd1a7c11a287cd2b0272c1396c56a8..63edf451bb8fbb019cf6b169d589d265d69725d7 100644 (file)
@@ -531,6 +531,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
 
     /* 345 */
     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 */
 } virQEMUCapsFlags;
index d6446d2eb2ce9f4cbc86dd869500aa98707223d1..9f1675aa55d7bcfd88158cd4f8f33bd42dd8d76d 100644 (file)
   <flag name='vhost-user-gpu'/>
   <flag name='vhost-user-vga'/>
   <flag name='ramfb'/>
+  <flag name='blockdev-file-dynamic-auto-read-only'/>
   <version>4001000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>43100241</microcodeVersion>
index 1ea633f45fd43aa45ede6c92916483fa81f1798d..81c5fa80fffc375d434dc67d9a15d0271364dc55 100644 (file)
   <flag name='vhost-user-gpu'/>
   <flag name='ramfb'/>
   <flag name='arm-max-cpu'/>
+  <flag name='blockdev-file-dynamic-auto-read-only'/>
   <version>4001050</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>61700242</microcodeVersion>
index 998e16ec6d625b76cbf239a228f1e0bc05159468..bc7042e7e1a74013b3738bbc8e86fa495705d6f6 100644 (file)
   <flag name='vhost-user-gpu'/>
   <flag name='vhost-user-vga'/>
   <flag name='machine.pseries.cap-ccf-assist'/>
+  <flag name='blockdev-file-dynamic-auto-read-only'/>
   <version>4001050</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>42900242</microcodeVersion>
index 902672bf7138dcb0d78c1709d92bdd6a6dc47d6b..714634dcc31631a8f05cb2a4d5121abe89db3da1 100644 (file)
   <flag name='vhost-user-gpu'/>
   <flag name='query-cpu-model-baseline'/>
   <flag name='query-cpu-model-comparison'/>
+  <flag name='blockdev-file-dynamic-auto-read-only'/>
   <version>4001050</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>39100242</microcodeVersion>
index d86b9ca7e53cc5d29b293292e2e4b07eafbf7ffa..0d04413664b8741143e84788b6b6d34c4c61d723 100644 (file)
   <flag name='vhost-user-gpu'/>
   <flag name='vhost-user-vga'/>
   <flag name='ramfb'/>
+  <flag name='blockdev-file-dynamic-auto-read-only'/>
   <version>4001092</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>43100242</microcodeVersion>