mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemuBlockGetBackingStoreString: Add extra wrapping object to JSON strings
QEMU requires an extra wrapper object where only the "file" member is populated. This is basically a placeholder for establishing the format layer. We did the same in qemuDiskSourceGetProps for the old-school JSON usage with -drive but forgot to adopt this for -blockdev. https://bugzilla.redhat.com/show_bug.cgi?id=1804617 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5a70f1048f
commit
7ba2208add
@ -2104,7 +2104,7 @@ qemuBlockGetBackingStoreString(virStorageSourcePtr src,
|
|||||||
if (!(backingJSON = virJSONValueToString(props, pretty)))
|
if (!(backingJSON = virJSONValueToString(props, pretty)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return g_strdup_printf("json:%s", backingJSON);
|
return g_strdup_printf("json:{\"file\":%s}", backingJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,6 @@ format:
|
|||||||
"driver": "qcow2",
|
"driver": "qcow2",
|
||||||
"file": "0123456789ABCDEF0123456789ABCDE",
|
"file": "0123456789ABCDEF0123456789ABCDE",
|
||||||
"size": 8589934590,
|
"size": 8589934590,
|
||||||
"backing-file": "json:{\"driver\":\"raw\",\"offset\":1234,\"size\":5768,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.qcow2\"}}",
|
"backing-file": "json:{\"file\":{\"driver\":\"raw\",\"offset\":1234,\"size\":5768,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.qcow2\"}}}",
|
||||||
"backing-fmt": "qcow2"
|
"backing-fmt": "qcow2"
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@ format:
|
|||||||
"driver": "qcow2",
|
"driver": "qcow2",
|
||||||
"file": "0123456789ABCDEF0123456789ABCDE",
|
"file": "0123456789ABCDEF0123456789ABCDE",
|
||||||
"size": 8589934590,
|
"size": 8589934590,
|
||||||
"backing-file": "json:{\"driver\":\"raw\",\"offset\":9876,\"size\":54321,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.img\"}}",
|
"backing-file": "json:{\"file\":{\"driver\":\"raw\",\"offset\":9876,\"size\":54321,\"file\":{\"driver\":\"file\",\"filename\":\"/var/lib/libvirt/images/i.img\"}}}",
|
||||||
"backing-fmt": "raw"
|
"backing-fmt": "raw"
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
backing store string:
|
backing store string:
|
||||||
json:{
|
json:{"file":{
|
||||||
"driver": "rbd",
|
"driver": "rbd",
|
||||||
"pool": "rbdpool",
|
"pool": "rbdpool",
|
||||||
"image": "rbdimg",
|
"image": "rbdimg",
|
||||||
@ -31,6 +31,7 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
source only properties:
|
source only properties:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
backing store string:
|
backing store string:
|
||||||
json:{
|
json:{"file":{
|
||||||
"driver": "rbd",
|
"driver": "rbd",
|
||||||
"pool": "rbdpool",
|
"pool": "rbdpool",
|
||||||
"image": "rbdimg",
|
"image": "rbdimg",
|
||||||
@ -31,6 +31,7 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
source only properties:
|
source only properties:
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
"namespace": 1
|
"namespace": 1
|
||||||
}
|
}
|
||||||
backing store string:
|
backing store string:
|
||||||
json:{
|
json:{"file":{
|
||||||
"driver": "nvme",
|
"driver": "nvme",
|
||||||
"device": "0000:01:00.0",
|
"device": "0000:01:00.0",
|
||||||
"namespace": 1
|
"namespace": 1
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user