On 06/18/2013 04:36 AM, Osier Yang wrote:
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(-)
I don't now about this one. What concerns me is the code that was run
just before this movement, specifically:
/*
* Normally PCI addresses are assigned in the virDomainCreate
* or virDomainDefine methods. We might still need to assign
* some here to cope with the question of upgrades. Regardless
* we also need to populate the PCi address set cache for later
* use in hotplug
*/
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Assigning domain PCI addresses");
if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
goto cleanup;
}
I didn't chase into the code, but I would think that PCI assignment
could play a role in disk placements.
I guess, I'm not comfortable with taking that leap of faith - perhaps
someone else knows for certain.
John
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c412ea2..351440b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3552,6 +3552,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;
@@ -3598,11 +3606,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,