]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: block: Use 'auto-read-only' instead of 'read-only' for backing chain
authorPeter Krempa <pkrempa@redhat.com>
Tue, 4 Sep 2018 17:29:10 +0000 (19:29 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 18 Jul 2019 15:59:34 +0000 (17:59 +0200)
To allow using -blockdev with blockjobs QEMU needs to reopen files in
read-write mode when modifying the backing chain. 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 (since commit 23dece19da4) 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.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
39 files changed:
src/qemu/qemu_block.c
src/qemu/qemu_block.h
src/qemu/qemu_command.c
src/qemu/qemu_migration.c
tests/qemublocktest.c
tests/qemublocktestdata/xml2json/block-raw-noopts.json
tests/qemublocktestdata/xml2json/block-raw-reservations.json
tests/qemublocktestdata/xml2json/dir-fat-cache.json
tests/qemublocktestdata/xml2json/dir-fat-floppy.json
tests/qemublocktestdata/xml2json/dir-fat-readonly.json
tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads.json
tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync.json
tests/qemublocktestdata/xml2json/file-backing_basic-cache-none.json
tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe.json
tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback.json
tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough.json
tests/qemublocktestdata/xml2json/file-backing_basic-detect.json
tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json
tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect.json
tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore.json
tests/qemublocktestdata/xml2json/file-backing_basic-unmap.json
tests/qemublocktestdata/xml2json/file-bochs-noopts.json
tests/qemublocktestdata/xml2json/file-cloop-noopts.json
tests/qemublocktestdata/xml2json/file-dmg-noopts.json
tests/qemublocktestdata/xml2json/file-ploop-noopts.json
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
tests/qemublocktestdata/xml2json/file-raw-aio_native.json
tests/qemublocktestdata/xml2json/file-raw-luks.json
tests/qemublocktestdata/xml2json/file-raw-noopts.json
tests/qemublocktestdata/xml2json/file-vdi-noopts.json
tests/qemublocktestdata/xml2json/file-vhd-noopts.json
tests/qemublocktestdata/xml2json/file-vpc-noopts.json
tests/qemublocktestdata/xml2json/network-nbd-tls.json
tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe.json
tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth.json
tests/qemuxml2argvdata/qemu-ns.x86_64-4.0.0.args
tests/qemuxml2argvdata/qemu-ns.x86_64-latest.args

index f32d9c70c83cd6902faab7ee1c624de1a27e1b9f..57481115ebb0313401628b55053aa6ecf9d21686 100644 (file)
@@ -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 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.
@@ -1034,11 +1035,23 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSourcePtr src,
 virJSONValuePtr
 qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
                                       bool legacy,
-                                      bool onlytarget)
+                                      bool onlytarget,
+                                      bool autoreadonly)
 {
     int actualType = virStorageSourceGetActualType(src);
     VIR_AUTOPTR(virJSONValue) fileprops = NULL;
     const char *driver = NULL;
+    virTristateBool aro = VIR_TRISTATE_BOOL_ABSENT;
+    virTristateBool ro = VIR_TRISTATE_BOOL_ABSENT;
+
+    if (autoreadonly) {
+        aro = VIR_TRISTATE_BOOL_YES;
+    } else {
+        if (src->readonly)
+            ro = VIR_TRISTATE_BOOL_YES;
+        else
+            ro = VIR_TRISTATE_BOOL_NO;
+    }
 
     switch ((virStorageType)actualType) {
     case VIR_STORAGE_TYPE_BLOCK:
@@ -1142,7 +1155,8 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
                 return NULL;
 
             if (virJSONValueObjectAdd(fileprops,
-                                      "b:read-only", src->readonly,
+                                      "T:read-only", ro,
+                                      "T:auto-read-only", aro,
                                       "s:discard", "unmap",
                                       NULL) < 0)
                 return NULL;
@@ -1447,6 +1461,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
 /**
  * qemuBlockStorageSourceAttachPrepareBlockdev:
  * @src: storage source to prepare data from
+ * @autoreadonly: use 'auto-read-only' feature of qemu
  *
  * Creates a qemuBlockStorageSourceAttachData structure containing data to attach
  * @src to a VM using the blockdev-add approach. Note that this function only
@@ -1459,7 +1474,8 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
  * error is reported
  */
 qemuBlockStorageSourceAttachDataPtr
-qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src)
+qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
+                                            bool autoreadonly)
 {
     VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
 
@@ -1467,7 +1483,9 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src)
         return NULL;
 
     if (!(data->formatProps = qemuBlockStorageSourceGetBlockdevProps(src)) ||
-        !(data->storageProps = qemuBlockStorageSourceGetBackendProps(src, false, false)))
+        !(data->storageProps = qemuBlockStorageSourceGetBackendProps(src, false,
+                                                                     false,
+                                                                     autoreadonly)))
         return NULL;
 
     data->storageNodeName = src->nodestorage;
index 7b94f4f0ff019fe9554f8b6a8b1f2a06e257f517..12ddfad2aca40fac131957dfae1ec35f64e5d316 100644 (file)
@@ -59,7 +59,8 @@ qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src);
 virJSONValuePtr
 qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
                                       bool legacy,
-                                      bool onlytarget);
+                                      bool onlytarget,
+                                      bool autoreadonly);
 
 virURIPtr
 qemuBlockStorageSourceGetURI(virStorageSourcePtr src);
@@ -106,7 +107,8 @@ VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceAttachData,
                         qemuBlockStorageSourceAttachDataFree);
 
 qemuBlockStorageSourceAttachDataPtr
-qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src);
+qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
+                                            bool autoreadonly);
 
 qemuBlockStorageSourceAttachDataPtr
 qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src,
index eb2598119ef08df5d057ee01b43464e77bd925b1..1cf165079f5edca6ae532ce08b62f9b2b52b1817 100644 (file)
@@ -1602,7 +1602,7 @@ qemuDiskSourceGetProps(virStorageSourcePtr src)
     virJSONValuePtr props;
     virJSONValuePtr ret;
 
-    if (!(props = qemuBlockStorageSourceGetBackendProps(src, true, false)))
+    if (!(props = qemuBlockStorageSourceGetBackendProps(src, true, false, false)))
         return NULL;
 
     if (virJSONValueObjectCreate(&ret, "a:file", &props, NULL) < 0) {
@@ -11178,7 +11178,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top,
         return NULL;
 
     for (n = top; virStorageSourceIsBacking(n); n = n->backingStore) {
-        if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(n)))
+        if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(n, true)))
             return NULL;
 
         if (qemuBuildStorageSourceAttachPrepareCommon(n, elem, qemuCaps) < 0)
index 1fb88c11b661cdff82e133c511f519aed342eedc..c9a2d8cd451b58b3a89dc3aec6ec7ee23a2da0fc 100644 (file)
@@ -830,7 +830,9 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver,
         virAsprintf(&copysrc->nodeformat, "migration-%s-format", disk->dst) < 0)
         goto cleanup;
 
-    if (!(data = qemuBlockStorageSourceAttachPrepareBlockdev(copysrc)))
+    /* Migration via blockdev-mirror was supported sooner than the auto-read-only
+     * feature was added to qemu */
+    if (!(data = qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, false)))
         goto cleanup;
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm,
index e5ed52e19b8583c248b8c8813e8a7e194a9edf9b..e0b60bbec83943e7ede5c8d7c6d7239cc0ed155a 100644 (file)
@@ -67,7 +67,8 @@ testBackingXMLjsonXML(const void *args)
         return -1;
     }
 
-    if (!(backendprops = qemuBlockStorageSourceGetBackendProps(xmlsrc, true, false))) {
+    if (!(backendprops = qemuBlockStorageSourceGetBackendProps(xmlsrc, true, false,
+                                                               false))) {
         fprintf(stderr, "failed to format disk source json\n");
         return -1;
     }
@@ -222,8 +223,8 @@ testQemuDiskXMLToProps(const void *opaque)
             goto cleanup;
 
         if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n)) ||
-            !(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, false, true)) ||
-            !(storageProps = qemuBlockStorageSourceGetBackendProps(n, false, false))) {
+            !(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, false, true, true)) ||
+            !(storageProps = qemuBlockStorageSourceGetBackendProps(n, false, false, true))) {
             if (!data->fail) {
                 VIR_TEST_VERBOSE("failed to generate qemu blockdev props\n");
                 goto cleanup;
index f223659c76f7ac281a6d2f84f1c2e434b983c90f..fa8b29a1f9048ecee165e725c6d8495d3f12b529 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "host_device",
   "filename": "/dev/blah",
   "node-name": "0123456789ABCDEF0123456789ABCDE",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 2fb106d673b74b56c38b340d83375a5e5f40446c..970723279ddb77b1685db0b60115818353ccb8a3 100644 (file)
@@ -9,6 +9,6 @@
   "filename": "/dev/blah",
   "pr-manager": "node-a-st-pr-alias",
   "node-name": "node-a-st",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index ef33add681dc8b16e6f9bda62dea143ff1d80558..2a24175ef48c91fea88b2c4f43845a9dc064534b 100644 (file)
@@ -18,6 +18,6 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index db7954a6bc800c251b3b5632f98709c8ee96a9c6..3b4accb8efa7970b96197b54ea505949bef1dc8e 100644 (file)
@@ -10,6 +10,6 @@
   "floppy": true,
   "rw": false,
   "node-name": "node-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index a306fb4d47b560840bcf18ef85e212ee3be5883b..986e3a3ffdaeb09d535ed6edd4a3a51cec249c01 100644 (file)
@@ -10,6 +10,6 @@
   "floppy": false,
   "rw": false,
   "node-name": "node-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index a9bdd1bcc286ab87e7b866c4e4715d9448f6d4fc..e77421d372c54630d313e78cac5477b4b2f26ded 100644 (file)
@@ -10,7 +10,7 @@
   "filename": "/var/lib/libvirt/images/a",
   "aio": "threads",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -25,7 +25,7 @@
   "filename": "/var/lib/libvirt/images/b",
   "aio": "threads",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -47,7 +47,7 @@
     }
   ],
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -61,6 +61,6 @@
   "filename": "/var/lib/libvirt/images/d",
   "aio": "threads",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 18cd183cd8e00b4723692c8f52bc8f60fc6d27fb..1d5ae098136e0fff8cb1b5500ceb46ee2ae0830d 100644 (file)
@@ -17,7 +17,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -39,7 +39,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -69,7 +69,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -90,6 +90,6 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 18cd183cd8e00b4723692c8f52bc8f60fc6d27fb..1d5ae098136e0fff8cb1b5500ceb46ee2ae0830d 100644 (file)
@@ -17,7 +17,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -39,7 +39,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -69,7 +69,7 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -90,6 +90,6 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 4e92061c65a5c485f82cf4112ee26ff37bcb792c..4afd7366cf250aec13a7fdd31e7e78687d9bf774 100644 (file)
@@ -17,7 +17,7 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -39,7 +39,7 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -69,7 +69,7 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -90,6 +90,6 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index a105b47483ac59f179f937dea66551b35e89cc1c..9ed806eb047f64dd3c53a825fbba488920aa3d57 100644 (file)
@@ -17,7 +17,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -39,7 +39,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -69,7 +69,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -90,6 +90,6 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index a105b47483ac59f179f937dea66551b35e89cc1c..9ed806eb047f64dd3c53a825fbba488920aa3d57 100644 (file)
@@ -17,7 +17,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -39,7 +39,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -69,7 +69,7 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -90,6 +90,6 @@
     "direct": false,
     "no-flush": false
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 44a6e90fcdf76339fb9980656e5b84b8562fa78e..6be2df9d1d1a0bb7d57e0db5364632f6b9787c65 100644 (file)
@@ -10,7 +10,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -24,7 +24,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -46,7 +46,7 @@
     }
   ],
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -59,6 +59,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/d",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index b0fd9b698804b1762e1218d3f2b4d40873cebdbc..5916347b936d89eaca0d90613ac948b59928837f 100644 (file)
@@ -9,7 +9,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -23,7 +23,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -37,7 +37,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/c",
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -50,6 +50,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/d",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 6cf4e7709010d152a57d02f9ab02a69491d7055c..27e6e5ab60a18bffe5b9683183695a19336f3c4c 100644 (file)
@@ -11,7 +11,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -26,7 +26,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -49,7 +49,7 @@
     }
   ],
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -63,6 +63,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/d",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index b6e454297f0f9b50389caacee6f21f82bf957c2e..63c5cd2799d14f7dbe94991f501d25162c00c5ae 100644 (file)
@@ -11,7 +11,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -26,7 +26,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -49,7 +49,7 @@
     }
   ],
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -63,6 +63,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/d",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 21a10c854303659db78db7f8dc61c8e9d3401276..ac952c8acd210633def8d7d131b16f51d78c1b49 100644 (file)
@@ -10,7 +10,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -25,7 +25,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -48,7 +48,7 @@
     }
   ],
   "node-name": "node-c-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -62,6 +62,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/d",
   "node-name": "node-d-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 6ab43b2a1cc1901ac879f38802fc2b48a172c751..3692820436bd47008d2f6aeb0cbbb2328723b678 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index f709c3d3bdb53cbc39d05c186eda9ff1a0d473fc..7ae8b5ca5ffb597e74e202b286760a495a5055bc 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 55261de4b2ed6114f72ca7ce394fe6aedca45d7d..db722a55cc1489bd849dec2ed2eb6c52d28f9f24 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 81fa263098a50a1e728bf6365b57b86851fcb81c..7817b0980e76ce61553a45ec38b8c27ea8615b69 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 376fce9f9ee57022b1961b14dbc373428743fa79..57f1f61c05775657a7f6ca36f50bd688f3a5b025 100644 (file)
@@ -13,7 +13,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/a",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -31,6 +31,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/b",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 6bc6e2fe30122a675eb92adf43ef1f2fccc4a8ba..197ee2a4b635a73c262d76a0c60be6617c6558b9 100644 (file)
@@ -9,7 +9,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
   "node-name": "#block004",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -23,7 +23,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
   "node-name": "#block256",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -37,7 +37,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483615252",
   "node-name": "#block418",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -51,7 +51,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483605924",
   "node-name": "#block624",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -65,7 +65,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483605920",
   "node-name": "#block869",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -79,7 +79,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483546244",
   "node-name": "#block1047",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -93,7 +93,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483545901",
   "node-name": "#block1279",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483545313",
   "node-name": "#block1444",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1483536402",
   "node-name": "#block1602",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.qcow2",
   "node-name": "#block1864",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 454c07faec7a687dfa371bdf45b319d76480f7a0..3ffefa831ce19a4639ce47c783dc983d99733abd 100644 (file)
@@ -9,7 +9,7 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
   "node-name": "#block004",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -22,6 +22,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
   "node-name": "#block256",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 4e63561311f9754c5127d84cfc367f0915854ac0..1ae76895cdac4e97012d9c697dbde99b65b83d75 100644 (file)
@@ -17,6 +17,6 @@
     "direct": true,
     "no-flush": false
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index c26dd3bba5e120b61d8fc22647266c1c7e366edb..e4ed61db07b68a888cc4921e7efbe7717145b9c4 100644 (file)
@@ -9,6 +9,6 @@
   "driver": "file",
   "filename": "/path/luks.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index cace1f6448bad82dd37bd6c88cea6cba9f5c13a2..01160c825387583ab4cd517a714d77ebd1ca50e5 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/var/lib/libvirt/images/i.img",
   "node-name": "0123456789ABCDEF0123456789ABCDE",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 15f9da2091019638a37410a6c3b2d85ddc09fbf1..5d4d6dfe5a9c3eb0b2fa5b50d5d834a07145586f 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index ce96c4be8aaaead7359e252e758c8e92aca21275..6c810d2036ec0c5175464c96a6d091db0fcda501 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 9cba99e5674956846f5c0cc24ee7c355cfcd4dd5..69b8102cf44c1ab2f360451e71f1791a5e56350e 100644 (file)
@@ -8,6 +8,6 @@
   "driver": "file",
   "filename": "/path/to/i.img",
   "node-name": "test2",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index a1529a6c449c2656117fd69a3bcbca5baed811bb..0dc453fb7e05f564e1d109fd607a71589d69b2a5 100644 (file)
@@ -14,6 +14,6 @@
   },
   "tls-creds": "node-a-s-tls0",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index e66f62d24b792964624b84731e468c08d0a7b0f4..9ee18dba513a6646c4fd1e4c37a40447be7c5c42 100644 (file)
@@ -34,7 +34,7 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -59,6 +59,6 @@
     "direct": false,
     "no-flush": true
   },
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 921cb3ea6957112d5fe36d9897becc4181dc07ed..fb196419822b14dddbd0a9bcecf23fbf659c25cb 100644 (file)
@@ -30,7 +30,7 @@
   ],
   "key-secret": "node-a-s-secalias",
   "node-name": "node-a-s",
-  "read-only": false,
+  "auto-read-only": true,
   "discard": "unmap"
 }
 {
@@ -53,6 +53,6 @@
   "user": "testuser-iscsi",
   "password-secret": "node-b-s-secalias",
   "node-name": "node-b-s",
-  "read-only": true,
+  "auto-read-only": true,
   "discard": "unmap"
 }
index 6e059d336a75e4d950969226202d93621f55c76d..2f49af885bf09f303adabb6d34124461bfecda0a 100644 (file)
@@ -30,7 +30,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\
-"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
 "file":"libvirt-1-storage"}' \
 -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
index ebb7b0da37016c818d06c9a4f48a74c3f4adafe9..f898ab2e07bfe6e1a090b4c7cb8ba48e6bf7829f 100644 (file)
@@ -30,7 +30,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1",\
-"node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
 "file":"libvirt-1-storage"}' \
 -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \