mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
util: Rename variable in virStorageSourceNewFromBackingAbsolute
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:
parent
a2cdee57d2
commit
c856f72251
@ -3632,48 +3632,48 @@ virStorageSourcePtr
|
|||||||
virStorageSourceNewFromBackingAbsolute(const char *path)
|
virStorageSourceNewFromBackingAbsolute(const char *path)
|
||||||
{
|
{
|
||||||
const char *json;
|
const char *json;
|
||||||
virStorageSourcePtr ret;
|
virStorageSourcePtr def;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (VIR_ALLOC(ret) < 0)
|
if (VIR_ALLOC(def) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virStorageIsFile(path)) {
|
if (virStorageIsFile(path)) {
|
||||||
ret->type = VIR_STORAGE_TYPE_FILE;
|
def->type = VIR_STORAGE_TYPE_FILE;
|
||||||
|
|
||||||
if (VIR_STRDUP(ret->path, path) < 0)
|
if (VIR_STRDUP(def->path, path) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
ret->type = VIR_STORAGE_TYPE_NETWORK;
|
def->type = VIR_STORAGE_TYPE_NETWORK;
|
||||||
|
|
||||||
VIR_DEBUG("parsing backing store string: '%s'", path);
|
VIR_DEBUG("parsing backing store string: '%s'", path);
|
||||||
|
|
||||||
/* handle URI formatted backing stores */
|
/* handle URI formatted backing stores */
|
||||||
if ((json = STRSKIP(path, "json:")))
|
if ((json = STRSKIP(path, "json:")))
|
||||||
rc = virStorageSourceParseBackingJSON(ret, json);
|
rc = virStorageSourceParseBackingJSON(def, json);
|
||||||
else if (strstr(path, "://"))
|
else if (strstr(path, "://"))
|
||||||
rc = virStorageSourceParseBackingURI(ret, path);
|
rc = virStorageSourceParseBackingURI(def, path);
|
||||||
else
|
else
|
||||||
rc = virStorageSourceParseBackingColon(ret, path);
|
rc = virStorageSourceParseBackingColon(def, path);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
virStorageSourceNetworkAssignDefaultPorts(ret);
|
virStorageSourceNetworkAssignDefaultPorts(def);
|
||||||
|
|
||||||
/* Some of the legacy parsers parse authentication data since they are
|
/* Some of the legacy parsers parse authentication data since they are
|
||||||
* also used in other places. For backing store detection the
|
* also used in other places. For backing store detection the
|
||||||
* authentication data would be invalid anyways, so we clear it */
|
* authentication data would be invalid anyways, so we clear it */
|
||||||
if (ret->auth) {
|
if (def->auth) {
|
||||||
virStorageAuthDefFree(ret->auth);
|
virStorageAuthDefFree(def->auth);
|
||||||
ret->auth = NULL;
|
def->auth = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return def;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virStorageSourceFree(ret);
|
virStorageSourceFree(def);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user