]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Translate the volume type disk source before cgroup setting
authorOsier Yang <jyang@redhat.com>
Tue, 18 Jun 2013 08:36:42 +0000 (16:36 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 22 Jul 2013 18:03:31 +0000 (14:03 -0400)
The translation must be done before both of cgroup and security
setting, otherwise since the disk source is not translated yet,
it might be skipped on cgroup and security setting.

src/qemu/qemu_process.c

index 24ee6b1c9125a9d8a585db1570295307825df649..a46d944cb9f87eda17b696e3a75bd348a980efbb 100644 (file)
@@ -3663,6 +3663,14 @@ int qemuProcessStart(virConnectPtr conn,
     }
     hookData.nodemask = nodemask;
 
+    /* "volume" type disk's source must be translated before
+     * cgroup and security setting.
+     */
+    for (i = 0; i < vm->def->ndisks; i++) {
+        if (qemuTranslateDiskSourcePool(conn, vm->def->disks[i]) < 0)
+            goto cleanup;
+    }
+
     VIR_DEBUG("Setting up domain cgroup (if required)");
     if (qemuSetupCgroup(driver, vm, nodemask) < 0)
         goto cleanup;
@@ -3707,11 +3715,6 @@ int qemuProcessStart(virConnectPtr conn,
             goto cleanup;
     }
 
-    for (i = 0; i < vm->def->ndisks; i++) {
-        if (qemuTranslateDiskSourcePool(conn, vm->def->disks[i]) < 0)
-            goto cleanup;
-    }
-
     VIR_DEBUG("Building emulator command line");
     if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
                                      priv->monJSON, priv->qemuCaps,