diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 9a99dd6d779e22e4c84610b46a1e3cd2dff4ecae..427510bd6a73188712e9b3e28ff4fdf68ae2c595 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 bbff511657d7d1f4efe7d10491573b52f93bcb0b..d84dad052d87074d065452df6cead994812f3435 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;