[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [libvirt RFC PATCH 03/10] util: storage: Add support for ho
From: |
Peter Krempa |
Subject: |
[Qemu-block] [libvirt RFC PATCH 03/10] util: storage: Add support for host device backing specified via JSON |
Date: |
Fri, 15 Jul 2016 15:46:36 +0200 |
JSON pseudo protocol for qemu allows to explicitly specify devices.
Add convertor to the internal type.
---
src/util/virstoragefile.c | 2 ++
tests/virstoragetest.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 826e4ba..2e47bdb 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -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},
};
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index aa56b61..24bb419 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1361,6 +1361,12 @@ mymain(void)
TEST_BACKING_PARSE(10, "json:{\"file.driver\":\"file\", "
"\"file.filename\":\"/path/to/file\"}",
"<source file='/path/to/file'/>\n");
+ TEST_BACKING_PARSE(11, "json:{\"file.driver\":\"host_device\", "
+ "\"file.filename\":\"/path/to/dev\"}",
+ "<source dev='/path/to/dev'/>\n");
+ TEST_BACKING_PARSE(12, "json:{\"file.driver\":\"host_cdrom\", "
+ "\"file.filename\":\"/path/to/cdrom\"}",
+ "<source dev='/path/to/cdrom'/>\n");
cleanup:
/* Final cleanup */
--
2.8.2
- [Qemu-block] [libvirt RFC PATCH 00/10] Add support for qemu's JSON pseudo'protocol for backing store, Peter Krempa, 2016/07/15
- [Qemu-block] [libvirt RFC PATCH 03/10] util: storage: Add support for host device backing specified via JSON,
Peter Krempa <=
- [Qemu-block] [libvirt RFC PATCH 01/10] tests: Add testing of backing store string parser, Peter Krempa, 2016/07/15
- [Qemu-block] [libvirt RFC PATCH 04/10] util: storage: Add support for URI based backing volumes in qemu's JSON pseudo-protocol, Peter Krempa, 2016/07/15
- [Qemu-block] [libvirt RFC PATCH 05/10] util: storage: Add json pseudo protocol support for gluster volumes, Peter Krempa, 2016/07/15
- [Qemu-block] [libvirt RFC PATCH 02/10] util: storage: Add parser for qemu's "json" backing pseudo-protocol, Peter Krempa, 2016/07/15
- [Qemu-block] [libvirt RFC PATCH 06/10] util: storage: Add json pseudo protocol support for iSCSI volumes, Peter Krempa, 2016/07/15