提交 b347e5c7 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 84df98f2
......@@ -5053,14 +5053,15 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
ret = 0;
goto cleanup;
}
backingStore->id = depth;
src->backingStore = g_steal_pointer(&backingStore);
} else {
/* add terminator */
if (!(backingStore = virStorageSourceNew()))
if (!(src->backingStore = virStorageSourceNew()))
goto cleanup;
}
src->backingStore = g_steal_pointer(&backingStore);
if (src->externalDataStoreRaw) {
g_autoptr(virStorageSource) externalDataStore = NULL;
......@@ -5080,8 +5081,6 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
ret = 0;
cleanup:
if (virStorageSourceHasBacking(src))
src->backingStore->id = depth;
virStorageFileDeinit(src);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册