From nobody Mon Feb 9 09:16:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578662991; cv=none; d=zohomail.com; s=zohoarc; b=HRRozOSDplDJNa+AyGrDv+n1+Yp8SElKbQPEu7+4eV0FyBohiba10JlZoHuDSrpmvqT5NQx43qs+22De0XPIYGPK367abjhPyVMkhXQkQptfaUcz7dwoycfBk/7/fokWaJ0JHMN0TGQPs5dCgAGgAOB4eBQBR4Vbte/rMQPIIHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578662991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sFDUZ3ygsqVbcL0eELXXO0gj0pTx5IZPYIKbPxxHygs=; b=ccr62Knatmir5XNhE046i7occ/sWq5xLcb6vK5ZGd+lrXGPABE31kT+/6OF+R7YMZ5FTQuN/domA376ffjYmnJA2BoIcj3AvCRKvu8PFDbgvIeRdmMxSvXAA/pDDT/jqo0BfCGo57ayZU9+Vd005Ubfv5Jd32IhXmdvuUXMQQd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578662991417717.625029912213; Fri, 10 Jan 2020 05:29:51 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipuLp-00020r-12; Fri, 10 Jan 2020 13:29:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipuLn-00020G-Eg for xen-devel@lists.xenproject.org; Fri, 10 Jan 2020 13:29:19 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2eb65fa8-33ad-11ea-bf0f-12813bfff9fa; Fri, 10 Jan 2020 13:29:10 +0000 (UTC) X-Inumbo-ID: 2eb65fa8-33ad-11ea-bf0f-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578662950; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=aG8+e2m6AN5IfUjMx9VppTrvS/t/KQQmarqMBDQ8J/I=; b=Yvy8iVNhfdcrlKdUYUlHn6dY4P+QcF9sMviO7MJ5N1jECvQ8O0raA4jb LEYovAvNIt92HLumqHVUx5tyiDL3suLTCj9frf1rjDKbaWZ360Mbaq4cB i+pjd2sqaJhsSpXsCCeU4t3cgkDYCi7PQXRjVlCtMEXHu3pwk6LFRK2vZ A=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 2DYSPbzP+uGeMFalpiQ2L9HghOLyymfQ+owA9CnmFMuj1eVe+HfEx4llJ01kjzJzoVfpfIoJz0 utg7o1fcOtEqUlEa4GjAc4F8OVTrY0Exz056+lyyMJAiRUKiahiVjGDM94eYGec0ri1amV6Edp YtcitGEqxuk7SLMl1M3tDcLx+RV9epRksbuKFjh7jS+bwt/LJsb84BY+Dkg9B+6gSeeNEWXlxS iSlD7bhx+X0eFvz27CUxWpc0/up/0gXStmSmTbB4g1ZbEB4/p9u9gjTXXMc7TWZY6twhL/GG9m qrU= X-SBRS: 2.7 X-MesageID: 10902442 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,417,1571716800"; d="scan'208";a="10902442" From: Ian Jackson To: Date: Fri, 10 Jan 2020 13:28:57 +0000 Message-ID: <20200110132902.29295-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200110132902.29295-1-ian.jackson@eu.citrix.com> References: <20200110132902.29295-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/8] libxl: event: Introduce CTX_UNLOCK_EGC_FREE X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , George Dunlap , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This is a very common exit pattern. We are going to want to change this pattern. So we should make it into a macro of its own. No functional change. Signed-off-by: Ian Jackson --- tools/libxl/libxl_event.c | 18 ++++++------------ tools/libxl/libxl_fork.c | 6 ++---- tools/libxl/libxl_internal.h | 2 ++ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 5b12a45e70..be37e12bb0 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -1152,8 +1152,7 @@ int libxl_osevent_beforepoll(libxl_ctx *ctx, int *nfd= s_io, CTX_LOCK; int rc =3D beforepoll_internal(gc, ctx->poller_app, nfds_io, fds, timeout_upd, now); - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; return rc; } =20 @@ -1305,8 +1304,7 @@ void libxl_osevent_afterpoll(libxl_ctx *ctx, int nfds= , const struct pollfd *fds, EGC_INIT(ctx); CTX_LOCK; afterpoll_internal(egc, ctx->poller_app, nfds, fds, now); - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; } =20 /* @@ -1342,8 +1340,7 @@ void libxl_osevent_occurred_fd(libxl_ctx *ctx, void *= for_libxl, fd_occurs(egc, ev, revents_ign); =20 out: - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; } =20 void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl) @@ -1365,8 +1362,7 @@ void libxl_osevent_occurred_timeout(libxl_ctx *ctx, v= oid *for_libxl) time_occurs(egc, ev, ERROR_TIMEDOUT); =20 out: - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; } =20 void libxl__event_disaster(libxl__egc *egc, const char *msg, int errnoval, @@ -1546,8 +1542,7 @@ int libxl_event_check(libxl_ctx *ctx, libxl_event **e= vent_r, EGC_INIT(ctx); CTX_LOCK; int rc =3D event_check_internal(egc, event_r, typemask, pred, pred_use= r); - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; return rc; } =20 @@ -1772,8 +1767,7 @@ int libxl_event_wait(libxl_ctx *ctx, libxl_event **ev= ent_r, out: libxl__poller_put(ctx, poller); =20 - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; return rc; } =20 diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c index 0f1b6b518c..cf170b9085 100644 --- a/tools/libxl/libxl_fork.c +++ b/tools/libxl/libxl_fork.c @@ -483,8 +483,7 @@ int libxl_childproc_reaped(libxl_ctx *ctx, pid_t pid, i= nt status) assert(CTX->childproc_hooks->chldowner =3D=3D libxl_sigchld_owner_mainloop); int rc =3D childproc_reaped(egc, pid, status); - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; return rc; } =20 @@ -529,8 +528,7 @@ void libxl_childproc_sigchld_occurred(libxl_ctx *ctx) assert(CTX->childproc_hooks->chldowner =3D=3D libxl_sigchld_owner_mainloop); childproc_checkall(egc); - CTX_UNLOCK; - EGC_FREE; + CTX_UNLOCK_EGC_FREE; } =20 static void sigchld_selfpipe_handler(libxl__egc *egc, libxl__ev_fd *ev, diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 581d64b99c..983fffac7a 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2363,6 +2363,8 @@ _hidden void libxl__egc_cleanup(libxl__egc *egc); =20 #define EGC_FREE libxl__egc_cleanup(egc) =20 +#define CTX_UNLOCK_EGC_FREE do{ CTX_UNLOCK; EGC_FREE; }while(0) + =20 /* * Machinery for asynchronous operations ("ao") --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel