mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Rename variable in testStorageFileGetMetadata
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
e698af1768
commit
9916f2a3c8
@ -95,32 +95,32 @@ testStorageFileGetMetadata(const char *path,
|
|||||||
uid_t uid, gid_t gid)
|
uid_t uid, gid_t gid)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
virStorageSourcePtr ret = NULL;
|
virStorageSourcePtr def = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(ret) < 0)
|
if (VIR_ALLOC(def) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret->type = VIR_STORAGE_TYPE_FILE;
|
def->type = VIR_STORAGE_TYPE_FILE;
|
||||||
ret->format = format;
|
def->format = format;
|
||||||
|
|
||||||
if (stat(path, &st) == 0) {
|
if (stat(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;
|
||||||
} 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_STRDUP(ret->path, path) < 0)
|
if (VIR_STRDUP(def->path, path) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virStorageFileGetMetadata(ret, uid, gid, false) < 0)
|
if (virStorageFileGetMetadata(def, uid, gid, false) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return ret;
|
return def;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virStorageSourceFree(ret);
|
virStorageSourceFree(def);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user