]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemublocktest: Use "target only" mode in 'testJSONtoJSON' and 'testBackingXMLjsonXML'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 18 Oct 2023 14:18:40 +0000 (16:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 26 Oct 2023 07:02:23 +0000 (09:02 +0200)
Both tests pass a disk source definition which didn't go through the
preparation steps and thus contains only the target information that
were originally present, thus we should be using the
QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY flag.

For the same reason QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY
used in 'testJSONtoJSON' doesn't make sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemublocktest.c
tests/qemublocktestdata/jsontojson/curl-libguestfs-out.json
tests/qemublocktestdata/jsontojson/ssh-passthrough-libguestfs-out.json

index addd6460717aa2140ddd19598726342ba306de92..ce76150200c66f1a14e282c240ac8923edeedaa6 100644 (file)
@@ -59,7 +59,7 @@ testBackingXMLjsonXML(const void *args)
     g_autoptr(virStorageSource) xmlsrc = NULL;
     g_autoptr(virStorageSource) jsonsrc = NULL;
     g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
-    unsigned int backendpropsflags = 0;
+    unsigned int backendpropsflags = QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY;
 
     if (data->legacy)
         backendpropsflags |= QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY;
@@ -157,7 +157,7 @@ testJSONtoJSON(const void *args)
     }
 
     if (!(jsonsrcout = qemuBlockStorageSourceGetBackendProps(src,
-                                                             QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY))) {
+                                                             QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY))) {
         fprintf(stderr, "failed to format disk source json\n");
         return -1;
     }
index e130c7bd3c2407656fd256659d98732e678bda6c..8cfacb5bc8e22dce44a044f213e36bd466413307 100644 (file)
@@ -2,8 +2,7 @@
   "driver": "https",
   "url": "https://test.host:443/whatever.img",
   "sslverify": false,
+  "cookie": "some_cookie=\"some_value_or_whatever\"",
   "timeout": 2000,
-  "readahead": 65536,
-  "auto-read-only": true,
-  "discard": "unmap"
+  "readahead": 65536
 }
index 1f6032deb4b2f98913bb2ffb7c273af6cf0db51f..7855917e2efbfd22874d523b1214b96aaa8d8fae 100644 (file)
@@ -8,7 +8,5 @@
   "user": "testuser",
   "host-key-check": {
     "mode": "none"
-  },
-  "auto-read-only": true,
-  "discard": "unmap"
+  }
 }