From 884cc9d615f2ab9294e19c047a35fe1775dad955 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 5 Oct 2019 14:39:22 -0400 Subject: [PATCH] storagefile: Add externalDataStore member Add the plumbing to track a externalDataStoreRaw as a virStorageSource Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 9 +++++++++ src/util/virstoragefile.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 9a99dd6d77..427510bd6a 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -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); diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index bbff511657..d84dad052d 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -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;