提交 47f292dd 编写于 作者: P Peter Krempa

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.
上级 e91f767c
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册