提交 7ba2208a 编写于 作者: P Peter Krempa

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=1804617Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5a70f104
...@@ -2104,7 +2104,7 @@ qemuBlockGetBackingStoreString(virStorageSourcePtr src, ...@@ -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: ...@@ -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: ...@@ -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 @@ ...@@ -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 @@ ...@@ -31,6 +31,7 @@
} }
] ]
} }
}
) )
( (
source only properties: source only properties:
......
...@@ -16,7 +16,7 @@ ...@@ -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 @@ ...@@ -31,6 +31,7 @@
} }
] ]
} }
}
) )
( (
source only properties: source only properties:
......
...@@ -6,9 +6,10 @@ ...@@ -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
} }
}
) )
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册