g_autofree char *backingJSON = NULL;
if (!src->sliceStorage) {
- if (virStorageSourceIsLocalStorage(src))
+ if (virStorageSourceIsLocalStorage(src)) {
+ if (src->type == VIR_STORAGE_TYPE_DIR &&
+ src->format == VIR_STORAGE_FILE_FAT)
+ return g_strdup_printf("fat:%s", src->path);
+
return g_strdup(src->path);
+ }
/* generate simplified URIs for the easy cases */
if (actualType == VIR_STORAGE_TYPE_NETWORK &&
virStorageSourcePtr *src)
{
const char *json;
+ const char *dirpath;
int rc = 0;
g_autoptr(virStorageSource) def = NULL;
def->path = g_strdup(path);
} else {
+ if ((dirpath = STRSKIP(path, "fat:"))) {
+ def->type = VIR_STORAGE_TYPE_DIR;
+ def->format = VIR_STORAGE_FILE_FAT;
+ def->path = g_strdup(dirpath);
+ *src = g_steal_pointer(&def);
+ return 0;
+ }
+
def->type = VIR_STORAGE_TYPE_NETWORK;
VIR_DEBUG("parsing backing store string: '%s'", path);
"floppy": false
}
backing store string:
- /var/somefiles
+ fat:/var/somefiles
)
"floppy": true
}
backing store string:
- /var/somefiles
+ fat:/var/somefiles
)
"floppy": false
}
backing store string:
- /var/somefiles
+ fat:/var/somefiles
)
TEST_BACKING_PARSE_FULL(bck, xml, 0)
TEST_BACKING_PARSE("path", "<source file='path'/>\n");
+ TEST_BACKING_PARSE("fat:/somedir", "<source dir='/somedir'/>\n");
TEST_BACKING_PARSE("://", NULL);
TEST_BACKING_PARSE("http://example.com",
"<source protocol='http' name=''>\n"