util: Rename variable in virStorageSourceCopy

To prepare for subsequent change to use VIR_AUTOPTR logic rename
the @ret to @def.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
John Ferlan 2019-02-08 08:28:27 -05:00
parent 9f2cf5cc18
commit f035e2cd26

View File

@ -2256,98 +2256,98 @@ virStorageSourcePtr
virStorageSourceCopy(const virStorageSource *src, virStorageSourceCopy(const virStorageSource *src,
bool backingChain) bool backingChain)
{ {
virStorageSourcePtr ret = NULL; virStorageSourcePtr def = NULL;
if (VIR_ALLOC(ret) < 0) if (VIR_ALLOC(def) < 0)
return NULL; return NULL;
ret->id = src->id; def->id = src->id;
ret->type = src->type; def->type = src->type;
ret->protocol = src->protocol; def->protocol = src->protocol;
ret->format = src->format; def->format = src->format;
ret->capacity = src->capacity; def->capacity = src->capacity;
ret->allocation = src->allocation; def->allocation = src->allocation;
ret->has_allocation = src->has_allocation; def->has_allocation = src->has_allocation;
ret->physical = src->physical; def->physical = src->physical;
ret->readonly = src->readonly; def->readonly = src->readonly;
ret->shared = src->shared; def->shared = src->shared;
ret->haveTLS = src->haveTLS; def->haveTLS = src->haveTLS;
ret->tlsFromConfig = src->tlsFromConfig; def->tlsFromConfig = src->tlsFromConfig;
ret->detected = src->detected; def->detected = src->detected;
ret->debugLevel = src->debugLevel; def->debugLevel = src->debugLevel;
ret->debug = src->debug; def->debug = src->debug;
ret->iomode = src->iomode; def->iomode = src->iomode;
ret->cachemode = src->cachemode; def->cachemode = src->cachemode;
ret->discard = src->discard; def->discard = src->discard;
ret->detect_zeroes = src->detect_zeroes; def->detect_zeroes = src->detect_zeroes;
/* storage driver metadata are not copied */ /* storage driver metadata are not copied */
ret->drv = NULL; def->drv = NULL;
if (VIR_STRDUP(ret->path, src->path) < 0 || if (VIR_STRDUP(def->path, src->path) < 0 ||
VIR_STRDUP(ret->volume, src->volume) < 0 || VIR_STRDUP(def->volume, src->volume) < 0 ||
VIR_STRDUP(ret->relPath, src->relPath) < 0 || VIR_STRDUP(def->relPath, src->relPath) < 0 ||
VIR_STRDUP(ret->backingStoreRaw, src->backingStoreRaw) < 0 || VIR_STRDUP(def->backingStoreRaw, src->backingStoreRaw) < 0 ||
VIR_STRDUP(ret->snapshot, src->snapshot) < 0 || VIR_STRDUP(def->snapshot, src->snapshot) < 0 ||
VIR_STRDUP(ret->configFile, src->configFile) < 0 || VIR_STRDUP(def->configFile, src->configFile) < 0 ||
VIR_STRDUP(ret->nodeformat, src->nodeformat) < 0 || VIR_STRDUP(def->nodeformat, src->nodeformat) < 0 ||
VIR_STRDUP(ret->nodestorage, src->nodestorage) < 0 || VIR_STRDUP(def->nodestorage, src->nodestorage) < 0 ||
VIR_STRDUP(ret->compat, src->compat) < 0 || VIR_STRDUP(def->compat, src->compat) < 0 ||
VIR_STRDUP(ret->tlsAlias, src->tlsAlias) < 0 || VIR_STRDUP(def->tlsAlias, src->tlsAlias) < 0 ||
VIR_STRDUP(ret->tlsCertdir, src->tlsCertdir) < 0) VIR_STRDUP(def->tlsCertdir, src->tlsCertdir) < 0)
goto error; goto error;
if (src->nhosts) { if (src->nhosts) {
if (!(ret->hosts = virStorageNetHostDefCopy(src->nhosts, src->hosts))) if (!(def->hosts = virStorageNetHostDefCopy(src->nhosts, src->hosts)))
goto error; goto error;
ret->nhosts = src->nhosts; def->nhosts = src->nhosts;
} }
if (src->srcpool && if (src->srcpool &&
!(ret->srcpool = virStorageSourcePoolDefCopy(src->srcpool))) !(def->srcpool = virStorageSourcePoolDefCopy(src->srcpool)))
goto error; goto error;
if (src->features && if (src->features &&
!(ret->features = virBitmapNewCopy(src->features))) !(def->features = virBitmapNewCopy(src->features)))
goto error; goto error;
if (src->encryption && if (src->encryption &&
!(ret->encryption = virStorageEncryptionCopy(src->encryption))) !(def->encryption = virStorageEncryptionCopy(src->encryption)))
goto error; goto error;
if (src->perms && if (src->perms &&
!(ret->perms = virStoragePermsCopy(src->perms))) !(def->perms = virStoragePermsCopy(src->perms)))
goto error; goto error;
if (src->timestamps && if (src->timestamps &&
!(ret->timestamps = virStorageTimestampsCopy(src->timestamps))) !(def->timestamps = virStorageTimestampsCopy(src->timestamps)))
goto error; goto error;
if (virStorageSourceSeclabelsCopy(ret, src) < 0) if (virStorageSourceSeclabelsCopy(def, src) < 0)
goto error; goto error;
if (src->auth && if (src->auth &&
!(ret->auth = virStorageAuthDefCopy(src->auth))) !(def->auth = virStorageAuthDefCopy(src->auth)))
goto error; goto error;
if (src->pr && if (src->pr &&
!(ret->pr = virStoragePRDefCopy(src->pr))) !(def->pr = virStoragePRDefCopy(src->pr)))
goto error; goto error;
if (virStorageSourceInitiatorCopy(&ret->initiator, &src->initiator)) if (virStorageSourceInitiatorCopy(&def->initiator, &src->initiator))
goto error; goto error;
if (backingChain && src->backingStore) { if (backingChain && src->backingStore) {
if (!(ret->backingStore = virStorageSourceCopy(src->backingStore, if (!(def->backingStore = virStorageSourceCopy(src->backingStore,
true))) true)))
goto error; goto error;
} }
return ret; return def;
error: error:
virStorageSourceFree(ret); virStorageSourceFree(def);
return NULL; return NULL;
} }