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

Re: [libvirt] [PATCH] qemudDomainCreate: also check uuid



It appears that this patch was applied (in commit 45616162db2d1e807dbe70e60c67cb701cbd06d8) with the virDomainIsActive(vm) checks removed from qemudDomainCreate, such that we fail out with "domain [...] is already defined and running" even if the domain is only defined but not running.

The attached (completely trivial) patch (created against 301cbb70aa52db2d8c42bc9f9441366385f0a9c4) resolves this.
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index b8fd11c..a7ddf11 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2013,7 +2013,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
         return NULL;
 
     vm = virDomainFindByName(driver->domains, def->name);
-    if (vm) {
+    if (vm && virDomainIsActive(vm)) {
         qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
                          _("domain '%s' is already defined and running"),
                          def->name);
@@ -2021,7 +2021,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
         return NULL;
     }
     vm = virDomainFindByUUID(driver->domains, def->uuid);
-    if (vm) {
+    if (vm && virDomainIsActive(vm)) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
 
         virUUIDFormat(def->uuid, uuidstr);

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