[PATCH 1/2] qemuProcessStart: Parse backingStore for all disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]