qemuBlockGetNamedNodeData: Extract 'data_file_raw' flag

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>
This commit is contained in:
Peter Krempa
2025-09-23 18:57:00 +02:00
parent f8201b0032
commit 6e5a3334b2
5 changed files with 10 additions and 0 deletions
+3
View File
@@ -748,6 +748,9 @@ struct _qemuBlockNamedNodeData {
/* qcow2 subcluster allocation -> extended_l2 */
bool qcow2extendedL2;
/* qcow2 data file 'raw' feature is enabled */
bool qcow2dataFileRaw;
};
GHashTable *
+3
View 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));
}
}
+2
View 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++) {
@@ -15,6 +15,7 @@
"compat": "0.10",
"compression-type": "zlib",
"lazy-refcounts": false,
"data-file-raw": true,
"bitmaps": [
{
"flags": [
@@ -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