|
|
fbe740 |
From 9b5f10282394b3f3e2a54791f51c3eb8d21c40ce Mon Sep 17 00:00:00 2001
|
|
|
fbe740 |
Message-Id: <9b5f10282394b3f3e2a54791f51c3eb8d21c40ce@dist-git>
|
|
|
fbe740 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Date: Wed, 19 Feb 2020 15:10:01 +0100
|
|
|
fbe740 |
Subject: [PATCH] virDomainDiskTranslateSourcePool: Translate 'volume' disks in
|
|
|
fbe740 |
whole backing chain
|
|
|
fbe740 |
MIME-Version: 1.0
|
|
|
fbe740 |
Content-Type: text/plain; charset=UTF-8
|
|
|
fbe740 |
Content-Transfer-Encoding: 8bit
|
|
|
fbe740 |
|
|
|
fbe740 |
Now that we accept full backing chains on input nothing should prevent
|
|
|
fbe740 |
users from also using disk type 'VOLUME' for specifying the backing
|
|
|
fbe740 |
images.
|
|
|
fbe740 |
|
|
|
fbe740 |
Do the translation for the whole backing chain.
|
|
|
fbe740 |
|
|
|
fbe740 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
(cherry picked from commit 37f01262eed9f37dd5eb7de8b83edd2fea741054)
|
|
|
fbe740 |
|
|
|
fbe740 |
https://bugzilla.redhat.com/show_bug.cgi?id=1804603
|
|
|
fbe740 |
Message-Id: <68818efffb0a38e33237e0db9a2b370cef3b6eaa.1582120424.git.pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
---
|
|
|
fbe740 |
src/conf/domain_conf.c | 20 +++++++++++---------
|
|
|
fbe740 |
1 file changed, 11 insertions(+), 9 deletions(-)
|
|
|
fbe740 |
|
|
|
fbe740 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
fbe740 |
index ecd00aa8fc..b46b92aecf 100644
|
|
|
fbe740 |
--- a/src/conf/domain_conf.c
|
|
|
fbe740 |
+++ b/src/conf/domain_conf.c
|
|
|
fbe740 |
@@ -31407,18 +31407,20 @@ int
|
|
|
fbe740 |
virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def)
|
|
|
fbe740 |
{
|
|
|
fbe740 |
g_autoptr(virConnect) conn = NULL;
|
|
|
fbe740 |
+ virStorageSourcePtr n;
|
|
|
fbe740 |
|
|
|
fbe740 |
- if (def->src->type != VIR_STORAGE_TYPE_VOLUME)
|
|
|
fbe740 |
- return 0;
|
|
|
fbe740 |
+ for (n = def->src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
|
|
fbe740 |
+ if (n->type != VIR_STORAGE_TYPE_VOLUME || !n->srcpool)
|
|
|
fbe740 |
+ continue;
|
|
|
fbe740 |
|
|
|
fbe740 |
- if (!def->src->srcpool)
|
|
|
fbe740 |
- return 0;
|
|
|
fbe740 |
+ if (!conn) {
|
|
|
fbe740 |
+ if (!(conn = virGetConnectStorage()))
|
|
|
fbe740 |
+ return -1;
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
|
|
|
fbe740 |
- if (!(conn = virGetConnectStorage()))
|
|
|
fbe740 |
- return -1;
|
|
|
fbe740 |
-
|
|
|
fbe740 |
- if (virDomainStorageSourceTranslateSourcePool(def->src, conn) < 0)
|
|
|
fbe740 |
- return -1;
|
|
|
fbe740 |
+ if (virDomainStorageSourceTranslateSourcePool(n, conn) < 0)
|
|
|
fbe740 |
+ return -1;
|
|
|
fbe740 |
+ }
|
|
|
fbe740 |
|
|
|
fbe740 |
if (def->startupPolicy != 0 &&
|
|
|
fbe740 |
virStorageSourceGetActualType(def->src) != VIR_STORAGE_VOL_FILE) {
|
|
|
fbe740 |
--
|
|
|
fbe740 |
2.25.0
|
|
|
fbe740 |
|