Re: [PATCH v3 7/7] qemu: Translate the volume type disk source before cgroup setting

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

 



On 19/07/13 20:32, John Ferlan wrote:
From: Osier Yang <jyang@xxxxxxxxxx>

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 | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ef81536..d7deb0f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3627,6 +3627,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;
@@ -3671,11 +3679,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,
ack, a bit strange to ack my own patch though. may need to wait for a
second ack from others.


--
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]