[libvirt] [PATCH 5/9] qemu: Translate the source when starting domain

Osier Yang jyang at redhat.com
Wed Jan 30 18:11:30 UTC 2013


* src/qemu/qemu_driver.c (Use virDomainStorageTranslateDiskSourcePool to
  translate the source to the real underlying source in qemuDomainCreate
  and qemuDomainObjStart)
---
 src/qemu/qemu_driver.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 812bf95..979f633 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -70,6 +70,7 @@
 #include "viruuid.h"
 #include "domain_conf.h"
 #include "domain_audit.h"
+#include "domain_storage.h"
 #include "node_device_conf.h"
 #include "virpci.h"
 #include "virusb.h"
@@ -1656,6 +1657,9 @@ static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
                                         VIR_DOMAIN_XML_INACTIVE)))
         goto cleanup;
 
+    if (virDomainStorageTranslateDiskSourcePool(conn, vm->def) < 0)
+        goto cleanup;
+
     if (virSecurityManagerVerify(driver->securityManager, def) < 0)
         goto cleanup;
 
@@ -5527,6 +5531,9 @@ qemuDomainObjStart(virConnectPtr conn,
         }
     }
 
+    if (virDomainStorageTranslateDiskSourcePool(conn, vm->def) < 0)
+        goto cleanup;
+
     ret = qemuProcessStart(conn, driver, vm, NULL, -1, NULL, NULL,
                            VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags);
     virDomainAuditStart(vm, "booted", ret >= 0);
-- 
1.7.7.6




More information about the libvir-list mailing list