]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: check backing chains even when cgroup is omitted
authorEric Blake <eblake@redhat.com>
Wed, 20 Feb 2013 22:34:48 +0000 (15:34 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 21 Feb 2013 19:32:56 +0000 (12:32 -0700)
https://bugzilla.redhat.com/show_bug.cgi?id=896685 points out
a regression caused by commit 38c4a9c - libvirt only labels
the backing chain if the backing chain cache is populated, but
the code to populate the cache was only conditionally performed
if cgroup labeling was necessary.

* src/qemu/qemu_cgroup.c (qemuSetupCgroup): Hoist cache setup...
* src/qemu/qemu_process.c (qemuProcessStart): ...earlier into
caller, where it is now unconditional.

src/qemu/qemu_cgroup.c
src/qemu/qemu_process.c

index 4fde1aff51f41a9dd3c20c0f888dd12b98aed838..e65b486212e07bb7be9a3be557af5d7946ea996e 100644 (file)
@@ -234,9 +234,7 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
         }
 
         for (i = 0; i < vm->def->ndisks ; i++) {
-            if (qemuDomainDetermineDiskChain(driver, vm->def->disks[i],
-                                             false) < 0 ||
-                qemuSetupDiskCgroup(vm, cgroup, vm->def->disks[i]) < 0)
+            if (qemuSetupDiskCgroup(vm, cgroup, vm->def->disks[i]) < 0)
                 goto cleanup;
         }
 
index aade68268904ac8afb00ea9c541ccee33511fbce..b560d2ea5c0ab024b064270c070fd80e5b0fb750 100644 (file)
@@ -3706,6 +3706,11 @@ int qemuProcessStart(virConnectPtr conn,
         goto cleanup;
 
     VIR_DEBUG("Checking for CDROM and floppy presence");
+    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;