From nobody Tue May 13 23:57:37 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 1528824846817688.7594782354003; Tue, 12 Jun 2018 10:34:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1500D5F742; Tue, 12 Jun 2018 17:34:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBC4019005; Tue, 12 Jun 2018 17:34:04 +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 45CC518037EC; Tue, 12 Jun 2018 17:34:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5CHXIfx013316 for ; Tue, 12 Jun 2018 13:33:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3ACBA201E2AD; Tue, 12 Jun 2018 17:33:18 +0000 (UTC) Received: from dhcp-17-130.bos.redhat.com (dhcp-17-130.bos.redhat.com [10.18.17.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15AB7201E288; Tue, 12 Jun 2018 17:33:18 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Tue, 12 Jun 2018 13:33:03 -0400 Message-Id: <6ab66ce57804da2cf8d81b0a49a9fb5edef7846e.1528824678.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [PATCH libvirt 4/4] events: remove umlDomainEventQueue wrapper func 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 12 Jun 2018 17:34:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" And replace all calls with virObjectEventStateQueue such that: umlDomainEventQueue(driver, event); becomes: virObjectEventStateQueue(driver->domainEventState, event); And remove NULL checking from all callers. Signed-off-by: Anya Harter --- src/uml/uml_driver.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 53ec64e10f..0c5b7fcda7 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -125,8 +125,6 @@ static int umlOpenMonitor(struct uml_driver *driver, virDomainObjPtr vm); static int umlReadPidFile(struct uml_driver *driver, virDomainObjPtr vm); -static void umlDomainEventQueue(struct uml_driver *driver, - virObjectEventPtr event); =20 static int umlStartVMDaemon(virConnectPtr conn, struct uml_driver *driver, @@ -228,8 +226,7 @@ umlAutostartDomain(virDomainObjPtr vm, virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); - if (event) - umlDomainEventQueue(data->driver, event); + virObjectEventStateQueue(data->driver->domainEventState, event= ); } } virObjectUnlock(vm); @@ -425,10 +422,8 @@ umlInotifyEvent(int watch, } } virDomainObjEndAPI(&dom); - if (event) { - umlDomainEventQueue(driver, event); - event =3D NULL; - } + virObjectEventStateQueue(driver->domainEventState, event); + event =3D NULL; } =20 cleanup: @@ -646,8 +641,7 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int= newVM, void *opaque) virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); - if (event) - umlDomainEventQueue(driver, event); + virObjectEventStateQueue(driver->domainEventState, event); } } =20 @@ -783,8 +777,7 @@ static int umlProcessAutoDestroyDom(void *payload, virDomainObjListRemove(data->driver->domains, dom); =20 virDomainObjEndAPI(&dom); - if (event) - umlDomainEventQueue(data->driver, event); + virObjectEventStateQueue(data->driver->domainEventState, event); virHashRemoveEntry(data->driver->autodestroy, uuidstr); return 0; } @@ -1615,8 +1608,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr = conn, const char *xml, cleanup: virDomainDefFree(def); virDomainObjEndAPI(&vm); - if (event) - umlDomainEventQueue(driver, event); + virObjectEventStateQueue(driver->domainEventState, event); umlDriverUnlock(driver); virNWFilterUnlockFilterUpdates(); return dom; @@ -1689,8 +1681,7 @@ umlDomainDestroyFlags(virDomainPtr dom, =20 cleanup: virDomainObjEndAPI(&vm); - if (event) - umlDomainEventQueue(driver, event); + virObjectEventStateQueue(driver->domainEventState, event); umlDriverUnlock(driver); return ret; } @@ -1949,8 +1940,7 @@ static int umlDomainCreateWithFlags(virDomainPtr dom,= unsigned int flags) =20 cleanup: virDomainObjEndAPI(&vm); - if (event) - umlDomainEventQueue(driver, event); + virObjectEventStateQueue(driver->domainEventState, event); umlDriverUnlock(driver); virNWFilterUnlockFilterUpdates(); return ret; @@ -2587,13 +2577,6 @@ umlConnectDomainEventDeregisterAny(virConnectPtr con= n, } =20 =20 -/* driver must be locked before calling */ -static void umlDomainEventQueue(struct uml_driver *driver, - virObjectEventPtr event) -{ - virObjectEventStateQueue(driver->domainEventState, event); -} - static int umlConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list