提交 37f01262 编写于 作者: P Peter Krempa

virDomainDiskTranslateSourcePool: Translate 'volume' disks in whole backing chain

Now that we accept full backing chains on input nothing should prevent
users from also using disk type 'VOLUME' for specifying the backing
images.

Do the translation for the whole backing chain.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 63469116
......@@ -31562,18 +31562,20 @@ int
virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
{
g_autoptr(virConnect) conn = NULL;
virStorageSourcePtr n;
if (def->src->type != VIR_STORAGE_TYPE_VOLUME)
return 0;
if (!def->src->srcpool)
return 0;
for (n = def->src; virStorageSourceIsBacking(n); n = n->backingStore) {
if (n->type != VIR_STORAGE_TYPE_VOLUME || !n->srcpool)
continue;
if (!(conn = virGetConnectStorage()))
return -1;
if (!conn) {
if (!(conn = virGetConnectStorage()))
return -1;
}
if (virDomainStorageSourceTranslateSourcePool(def->src, conn) < 0)
return -1;
if (virDomainStorageSourceTranslateSourcePool(n, conn) < 0)
return -1;
}
if (def->startupPolicy != 0 &&
virStorageSourceGetActualType(def->src) != VIR_STORAGE_VOL_FILE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册