mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: storage: Add support for host device backing specified via JSON
JSON pseudo protocol for qemu allows to explicitly specify devices. Add convertor to the internal type.
This commit is contained in:
@@ -2545,6 +2545,8 @@ struct virStorageSourceJSONDriverParser {
|
||||
|
||||
static const struct virStorageSourceJSONDriverParser jsonParsers[] = {
|
||||
{"file", virStorageSourceParseBackingJSONPath, VIR_STORAGE_TYPE_FILE},
|
||||
{"host_device", virStorageSourceParseBackingJSONPath, VIR_STORAGE_TYPE_BLOCK},
|
||||
{"host_cdrom", virStorageSourceParseBackingJSONPath, VIR_STORAGE_TYPE_BLOCK},
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1370,6 +1370,12 @@ mymain(void)
|
||||
"}"
|
||||
"}",
|
||||
"<source file='/path/to/file'/>\n");
|
||||
TEST_BACKING_PARSE("json:{\"file.driver\":\"host_device\", "
|
||||
"\"file.filename\":\"/path/to/dev\"}",
|
||||
"<source dev='/path/to/dev'/>\n");
|
||||
TEST_BACKING_PARSE("json:{\"file.driver\":\"host_cdrom\", "
|
||||
"\"file.filename\":\"/path/to/cdrom\"}",
|
||||
"<source dev='/path/to/cdrom'/>\n");
|
||||
|
||||
cleanup:
|
||||
/* Final cleanup */
|
||||
|
||||
Reference in New Issue
Block a user