]> xenbits.xensource.com Git - libvirt.git/commitdiff
utils: storage: Fix JSON field name for uri based storage
authorPeter Krempa <pkrempa@redhat.com>
Tue, 16 Aug 2016 07:24:12 +0000 (09:24 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 16 Aug 2016 11:30:45 +0000 (13:30 +0200)
qemu uses 'url' instead of 'uri'. They unfortunately look very similar.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1367260

src/util/virstoragefile.c
tests/virstoragetest.c

index 6f7d131a82fe076e2f2d41067e3896e0771956f8..471aa1fcc4040d774501576442492b86fcf5ce23 100644 (file)
@@ -2684,9 +2684,9 @@ virStorageSourceParseBackingJSONUri(virStorageSourcePtr src,
 {
     const char *uri;
 
-    if (!(uri = virJSONValueObjectGetString(json, "uri"))) {
+    if (!(uri = virJSONValueObjectGetString(json, "url"))) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("missing URI in JSON backing volume definition"));
+                       _("missing 'url' in JSON backing volume definition"));
         return -1;
     }
 
index 3b19f59fa5f118eedb1f67d77afd7fb027246592..b3d59adc3fc97d7178e5a2380b946be4381ed066 100644 (file)
@@ -1377,19 +1377,19 @@ mymain(void)
                              "\"file.filename\":\"/path/to/cdrom\"}",
                        "<source dev='/path/to/cdrom'/>\n");
     TEST_BACKING_PARSE("json:{\"file.driver\":\"http\", "
-                             "\"file.uri\":\"http://example.com/file\"}",
+                             "\"file.url\":\"http://example.com/file\"}",
                        "<source protocol='http' name='file'>\n"
                        "  <host name='example.com'/>\n"
                        "</source>\n");
     TEST_BACKING_PARSE("json:{\"file\":{ \"driver\":\"http\","
-                                        "\"uri\":\"http://example.com/file\""
+                                        "\"url\":\"http://example.com/file\""
                                       "}"
                             "}",
                        "<source protocol='http' name='file'>\n"
                        "  <host name='example.com'/>\n"
                        "</source>\n");
     TEST_BACKING_PARSE("json:{\"file.driver\":\"ftp\", "
-                             "\"file.uri\":\"http://example.com/file\"}",
+                             "\"file.url\":\"http://example.com/file\"}",
                        NULL);
     TEST_BACKING_PARSE("json:{\"file.driver\":\"gluster\", "
                              "\"file.filename\":\"gluster://example.com/vol/file\"}",