mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
util: Rename variable in virStorageSourceNewFromBacking
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
c856f72251
commit
e698af1768
@ -3682,39 +3682,39 @@ virStorageSourcePtr
|
|||||||
virStorageSourceNewFromBacking(virStorageSourcePtr parent)
|
virStorageSourceNewFromBacking(virStorageSourcePtr parent)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
virStorageSourcePtr ret;
|
virStorageSourcePtr def;
|
||||||
|
|
||||||
if (virStorageIsRelative(parent->backingStoreRaw))
|
if (virStorageIsRelative(parent->backingStoreRaw))
|
||||||
ret = virStorageSourceNewFromBackingRelative(parent,
|
def = virStorageSourceNewFromBackingRelative(parent,
|
||||||
parent->backingStoreRaw);
|
parent->backingStoreRaw);
|
||||||
else
|
else
|
||||||
ret = virStorageSourceNewFromBackingAbsolute(parent->backingStoreRaw);
|
def = virStorageSourceNewFromBackingAbsolute(parent->backingStoreRaw);
|
||||||
|
|
||||||
if (ret) {
|
if (def) {
|
||||||
/* possibly update local type */
|
/* possibly update local type */
|
||||||
if (ret->type == VIR_STORAGE_TYPE_FILE) {
|
if (def->type == VIR_STORAGE_TYPE_FILE) {
|
||||||
if (stat(ret->path, &st) == 0) {
|
if (stat(def->path, &st) == 0) {
|
||||||
if (S_ISDIR(st.st_mode)) {
|
if (S_ISDIR(st.st_mode)) {
|
||||||
ret->type = VIR_STORAGE_TYPE_DIR;
|
def->type = VIR_STORAGE_TYPE_DIR;
|
||||||
ret->format = VIR_STORAGE_FILE_DIR;
|
def->format = VIR_STORAGE_FILE_DIR;
|
||||||
} else if (S_ISBLK(st.st_mode)) {
|
} else if (S_ISBLK(st.st_mode)) {
|
||||||
ret->type = VIR_STORAGE_TYPE_BLOCK;
|
def->type = VIR_STORAGE_TYPE_BLOCK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy parent's labelling and other top level stuff */
|
/* copy parent's labelling and other top level stuff */
|
||||||
if (virStorageSourceInitChainElement(ret, parent, true) < 0)
|
if (virStorageSourceInitChainElement(def, parent, true) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
ret->readonly = true;
|
def->readonly = true;
|
||||||
ret->detected = true;
|
def->detected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return def;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virStorageSourceFree(ret);
|
virStorageSourceFree(def);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user