mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00: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:
parent
e91f767c74
commit
47f292dd35
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user