]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBlockGetNamedNodeData: Extract 'data_file_raw' flag
authorPeter Krempa <pkrempa@redhat.com>
Mon, 8 Sep 2025 16:09:57 +0000 (18:09 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 23 Sep 2025 16:57:00 +0000 (18:57 +0200)
The 'data_file_raw' flag of qcow2 notifies that all data inside the
'data_file' is a raw image so can be used standalone without the
metadata without any problem (except for not updating the dirty
bitmaps).

Our migration safety checks will allow skipping the migration safety
check for these files as during migration we know it's safe to re-create
this on the destination in a location that isn't shared.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
tests/qemublocktest.c
tests/qemublocktestdata/bitmap/synthetic.json
tests/qemublocktestdata/bitmap/synthetic.out

index 750e7444fc0d167cc8b142298428e1d81e172cdb..8ef85ceb0ae26a92b44e42509c2ecccafce2c16b 100644 (file)
@@ -748,6 +748,9 @@ struct _qemuBlockNamedNodeData {
 
     /* qcow2 subcluster allocation -> extended_l2 */
     bool qcow2extendedL2;
+
+    /* qcow2 data file 'raw' feature is enabled */
+    bool qcow2dataFileRaw;
 };
 
 GHashTable *
index 2c8ae5198cdfcfaaaf485ea3b4ef0ed8d51d5e4c..9caade7bc9ae9905bdac32b0e189f064b3651516 100644 (file)
@@ -2775,6 +2775,9 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
 
             ignore_value(virJSONValueObjectGetBoolean(qcow2props, "extended-l2",
                                                       &ent->qcow2extendedL2));
+
+            ignore_value(virJSONValueObjectGetBoolean(qcow2props, "data-file-raw",
+                                                      &ent->qcow2dataFileRaw));
         }
     }
 
index 095a54e22cf981ceb71e68641ad96e8b261bc095..47746207ccc6de729b685c2e2f732d117727e7b9 100644 (file)
@@ -589,6 +589,8 @@ testQemuDetectBitmapsWorker(GHashTable *nodedata,
     virBufferAsprintf(buf, "%s:\n", nodename);
     if (data->qcow2v2)
         virBufferAddLit(buf, " qcow2 v2\n");
+    if (data->qcow2dataFileRaw)
+        virBufferAddLit(buf, " data-file-raw\n");
     virBufferAdjustIndent(buf, 1);
 
     for (i = 0; i < data->nbitmaps; i++) {
index cd468a42a2c3185b9ac991a8ffa77f8b3102eda4..1753830f699e453e786f6b8588d382a808f24d21 100644 (file)
@@ -15,6 +15,7 @@
           "compat": "0.10",
           "compression-type": "zlib",
           "lazy-refcounts": false,
+          "data-file-raw": true,
           "bitmaps": [
             {
               "flags": [
index 2d9545fc9be08d3353a8ceee1edd5852e4b28f13..45423903a05dfd1f9719469a5c2d0318e455df1b 100644 (file)
@@ -1,5 +1,6 @@
 libvirt-1-format:
  qcow2 v2
+ data-file-raw
   current: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0
    top-ok: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
  top-inactive: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0