From nobody Wed Dec 17 04:16:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524528075455942.1985174698501; Mon, 23 Apr 2018 17:01:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D811D356D6; Tue, 24 Apr 2018 00:01:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9504182C7D; Tue, 24 Apr 2018 00:01:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1993F4CAAA; Tue, 24 Apr 2018 00:01:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3O00d6O001182 for ; Mon, 23 Apr 2018 20:00:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 925C918A67; Tue, 24 Apr 2018 00:00:39 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-64.phx2.redhat.com [10.3.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EC1418A6F for ; Tue, 24 Apr 2018 00:00:39 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 20:00:03 -0400 Message-Id: <20180424000005.689-10-jferlan@redhat.com> In-Reply-To: <20180424000005.689-1-jferlan@redhat.com> References: <20180424000005.689-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/11] Remove check for duplicitous GenID in another VM X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 24 Apr 2018 00:01:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- 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, =20 =20 /** - * 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 =3D 0; - virDomainObjPtr startvm =3D opaque; - - /* Ignore ourselves as we're already locked */ - if (vm =3D=3D 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) =3D= =3D 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 =3D -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 =3D -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 =3D vm->privateData; @@ -5971,11 +5912,6 @@ qemuProcessGenID(virQEMUDriverPtr driver, } } =20 - /* 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; } =20 @@ -6057,7 +5993,7 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; logfile =3D qemuDomainLogContextGetWriteFD(logCtxt); =20 - if (qemuProcessGenID(driver, vm, flags) < 0) + if (qemuProcessGenID(vm, flags) < 0) goto cleanup; =20 VIR_DEBUG("Building emulator command line"); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list