mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-24 04:12:20 +00:00
virStorageFileGetMetadataRecurse: Shuffle around assignment of backing chain depth
Move the assignment to a place where we know that the backing store is present rather than having to check in the cleanup section. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
84df98f29e
commit
b347e5c7dd
@ -5053,14 +5053,15 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backingStore->id = depth;
|
||||||
|
src->backingStore = g_steal_pointer(&backingStore);
|
||||||
} else {
|
} else {
|
||||||
/* add terminator */
|
/* add terminator */
|
||||||
if (!(backingStore = virStorageSourceNew()))
|
if (!(src->backingStore = virStorageSourceNew()))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
src->backingStore = g_steal_pointer(&backingStore);
|
|
||||||
|
|
||||||
if (src->externalDataStoreRaw) {
|
if (src->externalDataStoreRaw) {
|
||||||
g_autoptr(virStorageSource) externalDataStore = NULL;
|
g_autoptr(virStorageSource) externalDataStore = NULL;
|
||||||
|
|
||||||
@ -5080,8 +5081,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (virStorageSourceHasBacking(src))
|
|
||||||
src->backingStore->id = depth;
|
|
||||||
virStorageFileDeinit(src);
|
virStorageFileDeinit(src);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user