[libvirt] [PATCH v2 09/11] Remove check for duplicitous GenID in another VM

John Ferlan jferlan at redhat.com
Tue Apr 24 00:00:03 UTC 2018


Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/qemu/qemu_process.c | 68 ++-----------------------------------------------
 1 file changed, 2 insertions(+), 66 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 06ec4ddeb9..bfc22b7d07 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5880,73 +5880,14 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver,
 
 
 /**
- * qemuProcessCheckGenID:
- * @vm: Domain to be checked
- * @opaque: Domain about to be started
- *
- * For each running domain, let's make sure the domain to be started doesn't
- * duplicate any running domain's genid GUID value
- *
- * Returns 0 on success, -1 on failure w/ error message set
- */
-static int
-qemuProcessCheckGenID(virDomainObjPtr vm,
-                      void *opaque)
-{
-    int ret = 0;
-    virDomainObjPtr startvm = opaque;
-
-    /* Ignore ourselves as we're already locked */
-    if (vm == startvm)
-        return 0;
-
-    virObjectLock(vm);
-
-    if (!virDomainObjIsActive(vm))
-        goto cleanup;
-
-    if (!vm->def->genidRequested)
-        goto cleanup;
-
-    if (memcmp(startvm->def->genid, vm->def->genid, VIR_UUID_BUFLEN) == 0) {
-        /* For a generated value, just change it. Perhaps a result of
-         * not using virDomainDefCopy which generates a new genid when
-         * def->genidRequested is true. */
-        if (startvm->def->genidGenerated) {
-            if (virUUIDGenerate(startvm->def->genid) < 0) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("failed to regenerate genid"));
-                ret = -1;
-            }
-        } else {
-            char guidstr[VIR_UUID_STRING_BUFLEN];
-
-            virUUIDFormat(startvm->def->genid, guidstr);
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("domain '%s' already running with genid '%s'"),
-                           vm->def->name, guidstr);
-            ret = -1;
-        }
-        goto cleanup;
-    }
-
- cleanup:
-    virObjectUnlock(vm);
-    return ret;
-}
-
-
-/**
  * qemuProcessGenID:
- * @driver: Pointer to driver
  * @vm: Pointer to domain object
  * @flags: qemuProcessStartFlags
  *
  * If this domain is requesting to use genid
  */
 static int
-qemuProcessGenID(virQEMUDriverPtr driver,
-                 virDomainObjPtr vm,
+qemuProcessGenID(virDomainObjPtr vm,
                  unsigned int flags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -5971,11 +5912,6 @@ qemuProcessGenID(virQEMUDriverPtr driver,
         }
     }
 
-    /* Now let's make sure the genid this domain has is not duplicitous
-     * with something else running. */
-    if (virDomainObjListForEach(driver->domains, qemuProcessCheckGenID, vm) < 0)
-        return -1;
-
     return 0;
 }
 
@@ -6057,7 +5993,7 @@ qemuProcessLaunch(virConnectPtr conn,
         goto cleanup;
     logfile = qemuDomainLogContextGetWriteFD(logCtxt);
 
-    if (qemuProcessGenID(driver, vm, flags) < 0)
+    if (qemuProcessGenID(vm, flags) < 0)
         goto cleanup;
 
     VIR_DEBUG("Building emulator command line");
-- 
2.13.6




More information about the libvir-list mailing list