]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: virstorage: Add test data for json specified raw image with offset/size
authorPeter Krempa <pkrempa@redhat.com>
Thu, 16 Jan 2020 15:02:15 +0000 (16:02 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2020 15:32:21 +0000 (16:32 +0100)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virstoragetest.c

index 6d62aab6544465e9fb8935011bdedc121c7d450b..25d41f0de45509720d69ffc599e80295ae22592e 100644 (file)
@@ -1593,6 +1593,15 @@ 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:{ \"driver\": \"raw\","
+                                    "\"offset\": 10752,"
+                                    "\"size\": 4063232,"
+                                    "\"file\": { \"driver\": \"file\","
+                                                "\"filename\": \"/tmp/testfle\""
+                                              "}"
+                                  "}",
+                            "<source file='/tmp/testfle'/>\n", 0);
+
 #endif /* WITH_YAJL */
 
  cleanup: