storagefile: Add externalDataStore member

Add the plumbing to track a externalDataStoreRaw as a virStorageSource

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-10-05 14:39:22 -04:00
parent 8863c03d7d
commit 884cc9d615
2 changed files with 12 additions and 0 deletions

View File

@ -2340,6 +2340,12 @@ virStorageSourceCopy(const virStorageSource *src,
return NULL;
}
if (src->externalDataStore) {
if (!(def->externalDataStore = virStorageSourceCopy(src->externalDataStore,
true)))
return NULL;
}
VIR_STEAL_PTR(ret, def);
return ret;
}
@ -2561,6 +2567,9 @@ virStorageSourceClear(virStorageSourcePtr def)
VIR_FREE(def->timestamps);
VIR_FREE(def->externalDataStoreRaw);
virObjectUnref(def->externalDataStore);
def->externalDataStore = NULL;
virStorageNetHostDefFree(def->nhosts, def->hosts);
virStorageAuthDefFree(def->auth);
virObjectUnref(def->privateData);

View File

@ -292,6 +292,9 @@ struct _virStorageSource {
/* backing chain of the storage source */
virStorageSourcePtr backingStore;
/* external data store storage source */
virStorageSourcePtr externalDataStore;
/* metadata for storage driver access to remote and local volumes */
virStorageDriverDataPtr drv;