]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Reformat output to highlight dataFile relationship
authorPeter Krempa <pkrempa@redhat.com>
Tue, 27 May 2025 14:55:06 +0000 (16:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2025 11:11:02 +0000 (13:11 +0200)
Move the 'dataFileRaw' field to the main block as it's based on the data
in the qcow2 header same as 'backingStoreRaw'.

Indent and annotate the corresponding dataFile block to show where it
belongs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 files changed:
tests/virstoragetest.c
tests/virstoragetestdata/out/directory-dir
tests/virstoragetestdata/out/directory-none
tests/virstoragetestdata/out/directory-raw
tests/virstoragetestdata/out/qcow2-auto_qcow2-qcow2_raw-raw
tests/virstoragetestdata/out/qcow2-auto_raw-raw-relative
tests/virstoragetestdata/out/qcow2-datafile
tests/virstoragetestdata/out/qcow2-protocol-backing-file
tests/virstoragetestdata/out/qcow2-protocol-backing-nbd
tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw
tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto
tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto
tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto
tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw
tests/virstoragetestdata/out/qcow2-qcow2_raw-raw-relative
tests/virstoragetestdata/out/qcow2-symlinks
tests/virstoragetestdata/out/qcow2datafile-qcow2_qcow2-datafile
tests/virstoragetestdata/out/qed-auto_raw
tests/virstoragetestdata/out/qed-qed_raw
tests/virstoragetestdata/out/raw-auto
tests/virstoragetestdata/out/raw-raw

index 78dc6446379674332da85a19c42cd66257d812c4..e568bd3141d064e4e111632257008a8f1dc99202 100644 (file)
@@ -179,12 +179,14 @@ testStorageChain(const void *args)
     for (elt = meta; virStorageSourceIsBacking(elt); elt = elt->backingStore) {
         g_autofree char *strippedPath = virTestStablePath(elt->path);
         g_autofree char *strippedBackingStoreRaw = virTestStablePath(elt->backingStoreRaw);
+        g_autofree char *strippedDataFileRaw = virTestStablePath(elt->dataFileRaw);
         g_autofree char *strippedRelPath = virTestStablePath(elt->relPath);
 
         virBufferAsprintf(&buf,
                           "path:%s\n"
                           "backingStoreRaw: %s\n"
                           "backingStoreRawFormat: %s(%d)\n"
+                          "dataFileRaw: %s\n"
                           "capacity: %lld\n"
                           "encryption: %d\n"
                           "relPath:%s\n"
@@ -196,6 +198,7 @@ testStorageChain(const void *args)
                           strippedBackingStoreRaw,
                           NULLSTR(virStorageFileFormatTypeToString(elt->backingStoreRawFormat)),
                           elt->backingStoreRawFormat,
+                          strippedDataFileRaw,
                           elt->capacity,
                           !!elt->encryption,
                           strippedRelPath,
@@ -205,18 +208,17 @@ testStorageChain(const void *args)
                           NULLSTR(elt->nhosts ? elt->hosts[0].name : NULL));
 
         if (elt->dataFileStore) {
-            g_autofree char *strippedPathDataFileRaw = virTestStablePath(elt->dataFileRaw);
             g_autofree char *strippedPathDataFile = virTestStablePath(elt->dataFileStore->path);
 
             virBufferAsprintf(&buf,
-                              "dataFileRaw: %s\n\n\n"
-                              "dataFileStoreSource:\n"
-                              "path: %s\n"
-                              "capacity: %lld\n"
-                              "encryption: %d\n"
-                              "type:%s\n"
-                              "format:%s\n",
-                              strippedPathDataFileRaw,
+                              " dataFileStoreSource for '%s':\n"
+                              "  path: %s\n"
+                              "  capacity: %lld\n"
+                              "  encryption: %d\n"
+                              "  type:%s\n"
+                              "  format:%s\n"
+                              "\n\n",
+                              strippedPath,
                               strippedPathDataFile,
                               elt->dataFileStore->capacity,
                               !!elt->dataFileStore->encryption,
index c6a2fa36737674704ddbc69e5f80609d98fe9d4f..ea3bb90191e2c59466d0e5f52933da8ad7e05142 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index c6a2fa36737674704ddbc69e5f80609d98fe9d4f..ea3bb90191e2c59466d0e5f52933da8ad7e05142 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index 6e190c97f42a824c02a1e378c8407d9a12ee60cf..a0b9f882ed0f28dbe300cd5993d9241acd7a2ff8 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index 0540be0c092ea40ea808319553268b4acb2dec22..14d9eb987be650021324590e9256861f8dab5fa4 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_BUILDDIR/virstoragedata/wrap
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index e145cca41738f09c628401fa00bd5b153563a8a6..b99f64ee97d7d78bb3acbe4a39749d9b6159daef 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index d0f46f7e1bcd1760bd5a39a90e2b2f605c97fd68..c395f7f65ca8377fd92e7b07c7e3c90c86133872 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/datafile.qcow2
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: raw
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -9,12 +10,10 @@ format:qcow2
 protocol:none
 hostname:<null>
 
-dataFileRaw: raw
-
+ dataFileStoreSource for 'ABS_SRCDIR/virstoragetestdata/images/datafile.qcow2':
+  path: ABS_SRCDIR/virstoragetestdata/images/raw
+  capacity: 0
+  encryption: 0
+  type:file
+  format:raw
 
-dataFileStoreSource:
-path: ABS_SRCDIR/virstoragetestdata/images/raw
-capacity: 0
-encryption: 0
-type:file
-format:raw
index d9d4c1316c8b097575200bf9ccf141e7bb625d62..d0bf4115521f70974f728398aa5a2af7926c009c 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2-protocol-backing-file.qcow2
 backingStoreRaw: raw
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:raw
index 360a496ab01fe3b12896e2ccaa7ff36fa140f181..d41a8538a645273b6a4d282a9b7a7c1ed424c8a9 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2-protocol-backing-nbd.qcow2
 backingStoreRaw: nbd+tcp://example.org:6000/blah
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 10485760
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:blah
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index 0c2bb0ddc438906c69d66f9322eba015e8d9e82c..1ec84d771e8fb901f2faa3e10f8aec2112e818de 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_nbd-raw.qcow2
 backingStoreRaw: nbd+tcp://example.org:6000/blah
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:blah
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index 58f1dd6d9e8d583bf2801cbe457239f8fbb1d084..4b6b4e228325b1cd59af52821d3c29a5012a71a5 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2
 backingStoreRaw: qcow2
 backingStoreRawFormat: <null>(-1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:qcow2
index 81263c4bc0b51978a832c85ce4b4093023f928de..79943f432ef008c522b76d665ea1ca698fdc98fc 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2
 backingStoreRaw: qcow2_qcow2-auto.qcow2
 backingStoreRawFormat: qcow2(14)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2
 backingStoreRaw: qcow2
 backingStoreRawFormat: <null>(-1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:qcow2_qcow2-auto.qcow2
@@ -23,6 +25,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:qcow2
index cbb8d6a33fa960a1e3135ba5d8ea7e13e10a8f45..02e2c5a966068a4833ac8c557f0adc98e758373b 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2
 backingStoreRaw: qcow2_raw-auto.qcow2
 backingStoreRawFormat: qcow2(14)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-auto.qcow2
 backingStoreRaw: raw
 backingStoreRawFormat: <null>(-1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:qcow2_raw-auto.qcow2
@@ -23,6 +25,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:raw
index de110299226034b373247a43279518caa00c06e1..843a013ef59bb9d0bd5c34c38394276bb146d91b 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_BUILDDIR/virstoragedata/wrap
 backingStoreRaw: ABS_BUILDDIR/virstoragedata/qcow2
 backingStoreRawFormat: qcow2(14)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_BUILDDIR/virstoragedata/qcow2
 backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -23,6 +25,7 @@ hostname:<null>
 path:ABS_BUILDDIR/virstoragedata/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index b4bfd432ad8befbe1602a6e240f0afcc88704aaa..33526cfd4811fc22e8685a31b668ab0745a7cc8f 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-raw-relative.qcow2
 backingStoreRaw: raw
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:raw
index f053f95fd78ad33b95a8655c06e8a9268c23b7c5..c74cf6be5381ca1b58cd883c694176b0b63f3700 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/sub/link2
 backingStoreRaw: ../sub/link1
 backingStoreRawFormat: qcow2(14)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/sub/../sub/link1
 backingStoreRaw: ../raw
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:../sub/link1
@@ -23,6 +25,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/sub/../sub/../raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:../raw
index cc8bac31387c6e89272d34823c6f84f8f9b28471..c5a5d99e9e6ed8d73ca070c93f6a8b1609cff6cc 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qcow2datafile-datafile.qcow2
 backingStoreRaw: datafile.qcow2
 backingStoreRawFormat: qcow2(14)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/datafile.qcow2
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: raw
 capacity: 1024
 encryption: 0
 relPath:datafile.qcow2
@@ -20,12 +22,10 @@ format:qcow2
 protocol:none
 hostname:<null>
 
-dataFileRaw: raw
-
+ dataFileStoreSource for 'ABS_SRCDIR/virstoragetestdata/images/datafile.qcow2':
+  path: ABS_SRCDIR/virstoragetestdata/images/raw
+  capacity: 0
+  encryption: 0
+  type:file
+  format:raw
 
-dataFileStoreSource:
-path: ABS_SRCDIR/virstoragetestdata/images/raw
-capacity: 0
-encryption: 0
-type:file
-format:raw
index 260c3fbc7908053b86b9a20b63a2607aa107a6ad..3905398142d05fc6f00a2342d40a1ffa96de1e78 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index a13d407a5f0668c5959007e7f026b3e09ddcce4b..5ae7fef357b52f83788a0aaa7d3ba4644bd5f6a2 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
 backingStoreRaw: raw
 backingStoreRawFormat: raw(1)
+dataFileRaw: <null>
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -12,6 +13,7 @@ hostname:<null>
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:raw
index 70ec22f309d0de1f3e518d378af2b38e6734a0c8..5eb1d716811309aada87f9bff4ed6a56888f861e 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>
index 70ec22f309d0de1f3e518d378af2b38e6734a0c8..5eb1d716811309aada87f9bff4ed6a56888f861e 100644 (file)
@@ -1,6 +1,7 @@
 path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 backingStoreRawFormat: none(0)
+dataFileRaw: <null>
 capacity: 0
 encryption: 0
 relPath:<null>