b856ae
From 82d5fe543720da6d83c1d6bfa1c347d7d9fda278 Mon Sep 17 00:00:00 2001
b856ae
From: Eric Blake <eblake@redhat.com>
b856ae
Date: Wed, 20 Feb 2013 15:34:48 -0700
b856ae
Subject: [PATCH] qemu: check backing chains even when cgroup is omitted
b856ae
b856ae
https://bugzilla.redhat.com/show_bug.cgi?id=896685 points out
b856ae
a regression caused by commit 38c4a9c - libvirt only labels
b856ae
the backing chain if the backing chain cache is populated, but
b856ae
the code to populate the cache was only conditionally performed
b856ae
if cgroup labeling was necessary.
b856ae
b856ae
* src/qemu/qemu_cgroup.c (qemuSetupCgroup): Hoist cache setup...
b856ae
* src/qemu/qemu_process.c (qemuProcessStart): ...earlier into
b856ae
caller, where it is now unconditional.
b856ae
---
b856ae
 src/qemu/qemu_cgroup.c  | 4 +---
b856ae
 src/qemu/qemu_process.c | 5 +++++
b856ae
 2 files changed, 6 insertions(+), 3 deletions(-)
b856ae
b856ae
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
b856ae
index 4fde1af..e65b486 100644
b856ae
--- a/src/qemu/qemu_cgroup.c
b856ae
+++ b/src/qemu/qemu_cgroup.c
b856ae
@@ -234,9 +234,7 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
b856ae
         }
b856ae
 
b856ae
         for (i = 0; i < vm->def->ndisks ; i++) {
b856ae
-            if (qemuDomainDetermineDiskChain(driver, vm->def->disks[i],
b856ae
-                                             false) < 0 ||
b856ae
-                qemuSetupDiskCgroup(vm, cgroup, vm->def->disks[i]) < 0)
b856ae
+            if (qemuSetupDiskCgroup(vm, cgroup, vm->def->disks[i]) < 0)
b856ae
                 goto cleanup;
b856ae
         }
b856ae
 
b856ae
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
b856ae
index aade682..b560d2e 100644
b856ae
--- a/src/qemu/qemu_process.c
b856ae
+++ b/src/qemu/qemu_process.c
b856ae
@@ -3706,6 +3706,11 @@ int qemuProcessStart(virConnectPtr conn,
b856ae
         goto cleanup;
b856ae
 
b856ae
     VIR_DEBUG("Checking for CDROM and floppy presence");
b856ae
+    for (i = 0; i < vm->def->ndisks ; i++) {
b856ae
+        if (qemuDomainDetermineDiskChain(driver, vm->def->disks[i],
b856ae
+                                         false) < 0)
b856ae
+            goto cleanup;
b856ae
+    }
b856ae
     if (qemuDomainCheckDiskPresence(driver, vm,
b856ae
                                     flags & VIR_QEMU_PROCESS_START_COLD) < 0)
b856ae
         goto cleanup;
b856ae
-- 
b856ae
1.8.1.2
b856ae