提交 4a083536 编写于 作者: P Peter Krempa

utils: storage: Add copying of PR definition to virStorageSource

Despite the warning that virStorageSourceCopy needs to be populated on
additions to the structure commit 68773054 neglected to implement the
copy function.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 4fbe2295
......@@ -2041,6 +2041,29 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src)
}
static virStoragePRDefPtr
virStoragePRDefCopy(virStoragePRDefPtr src)
{
virStoragePRDefPtr copy = NULL;
virStoragePRDefPtr ret = NULL;
if (VIR_ALLOC(copy) < 0)
return NULL;
copy->managed = src->managed;
if (VIR_STRDUP(copy->path, src->path) < 0 ||
VIR_STRDUP(copy->mgralias, src->mgralias) < 0)
goto cleanup;
VIR_STEAL_PTR(ret, copy);
cleanup:
virStoragePRDefFree(copy);
return ret;
}
virSecurityDeviceLabelDefPtr
virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src,
const char *model)
......@@ -2245,6 +2268,10 @@ virStorageSourceCopy(const virStorageSource *src,
!(ret->auth = virStorageAuthDefCopy(src->auth)))
goto error;
if (src->pr &&
!(ret->pr = virStoragePRDefCopy(src->pr)))
goto error;
if (backingChain && src->backingStore) {
if (!(ret->backingStore = virStorageSourceCopy(src->backingStore,
true)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册