[libvirt RFC 1/2] tests: storage: Add test data for json specified raw image with offset/size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



QEMU allows specifying the offset and size into a raw file to expose a
sub-slice of the image to the guest with the raw driver. Libvirt
currently doesn't support it but we can add test case for future
reference.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/virstoragetest.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 2862758752..58e15c0cc4 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1559,6 +1559,16 @@ mymain(void)
                        "<source protocol='vxhs' name='c6718f6b-0401-441d-a8c3-1f0064d75ee0'>\n"
                        "  <host name='example.com' port='9999'/>\n"
                        "</source>\n");
+    TEST_BACKING_PARSE_FULL("json:{ \"file\": { \"driver\": \"raw\","
+                                               "\"offset\": 10752,"
+                                               "\"size\": 4063232,"
+                                               "\"file\": { \"driver\": \"file\","
+                                                           "\"filename\": \"/tmp/testfle\""
+                                                          "}"
+                                             "}"
+                                  "}",
+                            "<source file='/tmp/testfle'/>\n", 0);
+
 #endif /* WITH_YAJL */

  cleanup:
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux