Later, in the next commit, we are going to need backing chain
for all the disks within the domain. Let's parse them at domain
startup phase.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 11 +++--------
src/qemu/qemu_process.c | 6 +++++-
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 91c632c..54bcce9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2788,17 +2788,12 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
virFileExists(virDomainDiskGetSource(disk)))
continue;
- if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) >= 0)
- continue;
-
if (disk->startupPolicy &&
qemuDomainCheckDiskStartupPolicy(driver, vm, idx,
- cold_boot) >= 0) {
- virResetLastError();
- continue;
- }
+ cold_boot) < 0)
+ goto error;
- goto error;
+ virResetLastError();
}
ret = 0;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f7eb2b6..693ec33 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4661,7 +4661,11 @@ int qemuProcessStart(virConnectPtr conn,
* cgroup and security setting.
*/
for (i = 0; i < vm->def->ndisks; i++) {
- if (virStorageTranslateDiskSourcePool(conn, vm->def->disks[i]) < 0)
+ virDomainDiskDefPtr disk = vm->def->disks[i];
+ if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
+ goto cleanup;
+
+ if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) < 0)
goto cleanup;
}
--
2.4.6