[libvirt] [PATCH 3/5] qemu: move disk presence checking before disk chain construction

Guannan Ren gren at redhat.com
Mon Mar 18 09:10:20 UTC 2013


This patch makes preparations for disk droping if they are not accessable
when using startupPolicy "optional". That is to say, the patch aims to
perform the disk presense checking before making disk chain.
---
 src/qemu/qemu_process.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1941d4e..3d2b7d6 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3621,14 +3621,15 @@ int qemuProcessStart(virConnectPtr conn,
         goto cleanup;
 
     VIR_DEBUG("Checking for CDROM and floppy presence");
+    if (qemuDomainCheckDiskPresence(driver, vm,
+                                    flags & VIR_QEMU_PROCESS_START_COLD) < 0)
+        goto cleanup;
+
     for (i = 0; i < vm->def->ndisks ; i++) {
         if (qemuDomainDetermineDiskChain(driver, vm->def->disks[i],
                                          false) < 0)
             goto cleanup;
     }
-    if (qemuDomainCheckDiskPresence(driver, vm,
-                                    flags & VIR_QEMU_PROCESS_START_COLD) < 0)
-        goto cleanup;
 
     /* Get the advisory nodeset from numad if 'placement' of
      * either <vcpu> or <numatune> is 'auto'.
-- 
1.7.11.2




More information about the libvir-list mailing list