}
+static int
+virStorageSourceParseBackingJSONInternal(virStorageSourcePtr src,
+ virJSONValuePtr json);
+
+
static int
virStorageSourceParseBackingJSONPath(virStorageSourcePtr src,
virJSONValuePtr json,
return -1;
}
+static int
+virStorageSourceParseBackingJSONRaw(virStorageSourcePtr src,
+ virJSONValuePtr json,
+ int opaque ATTRIBUTE_UNUSED)
+{
+ /* There are no interesting attributes in raw driver.
+ * Treat it as pass-through.
+ */
+ return virStorageSourceParseBackingJSONInternal(src, json);
+}
struct virStorageSourceJSONDriverParser {
const char *drvname;
{"sheepdog", virStorageSourceParseBackingJSONSheepdog, 0},
{"ssh", virStorageSourceParseBackingJSONSSH, 0},
{"rbd", virStorageSourceParseBackingJSONRBD, 0},
+ {"raw", virStorageSourceParseBackingJSONRaw, 0},
};
"<source protocol='rbd' name='testshare'>\n"
" <host name='example.com'/>\n"
"</source>\n");
+ TEST_BACKING_PARSE("json:{ \"file\": { "
+ "\"driver\": \"raw\","
+ "\"file\": {"
+ "\"driver\": \"file\","
+ "\"filename\": \"/path/to/file\" } } }",
+ "<source file='/path/to/file'/>\n");
cleanup:
/* Final cleanup */