Storage driver uses virStorageSource only partially to store it's
configuration but fully when parsing backing files of storage volumes.
This patch sets the 'type' field to a value other than
VIR_STORAGE_TYPE_NONE so that further patches can add a terminator
element to backing chains without breaking iteration.
if (VIR_ALLOC(ret) < 0)
return NULL;
+ ret->target.type = VIR_STORAGE_TYPE_FILE;
+
ret->name = virXPathString("string(./name)", ctxt);
if (ret->name == NULL) {
virReportError(VIR_ERR_XML_ERROR, "%s",
if (VIR_ALLOC(ret->target.backingStore) < 0)
goto error;
+ ret->target.backingStore->type = VIR_STORAGE_TYPE_FILE;
+
ret->target.backingStore->path = backingStore;
backingStore = NULL;
if (VIR_ALLOC(vol->target.backingStore) < 0)
goto cleanup;
+ vol->target.backingStore->type = VIR_STORAGE_TYPE_NETWORK;
+
vol->target.backingStore->path = meta->backingStoreRaw;
if (backingFormat < 0)
goto cleanup;
vol->target.backingStore->format = VIR_STORAGE_POOL_LOGICAL_LVM2;
+ vol->target.backingStore->type = VIR_STORAGE_TYPE_BLOCK;
}
if (!vol->key && VIR_STRDUP(vol->key, groups[2]) < 0)