From nobody Mon Feb 9 16:12:45 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.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=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1574097256; cv=none; d=zoho.com; s=zohoarc; b=YX1/FnS3uKqeu2zXe+mcXiWyYtbEQ79xUWWNB2WrhzF5jvNkFKX36r72txDtE0p74QROH+WHAGFXCMm1l8oEtA7U7XlTRw1qc4e1ParWa5QqTLdE42xJZzpb1Y1Ru17abM9plGHKKniZTerDNCOT/2uIQ60FClwvHbU0ntPPfag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574097256; 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=+Nx25FSHIyj+durZPtvtB4gOD6g2xTyTKEDEMGkyEzo=; b=b9pQSInKia1e8abrFZ5TDdPPD/kdALBR3lZ0+z93WhBfiVUk9vgCdzMaPLI1EraPEIbQjiPSLRA5GBX0Upyynxb7s71u3ub27ZxjW4QcwDcShKEHeqM2D9YSpxJr9sAIFyltNi8+tgdP4j5HmGwoMltA1pJwpeQpJ3x71idJemo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.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 157409725668834.47841133247323; Mon, 18 Nov 2019 09:14:16 -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 1iWkaV-0005z6-UH; Mon, 18 Nov 2019 17:13:19 +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 1iWkaU-0005yk-DQ for xen-devel@lists.xenproject.org; Mon, 18 Nov 2019 17:13:18 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b31107c2-0a26-11ea-a2db-12813bfff9fa; Mon, 18 Nov 2019 17:13:12 +0000 (UTC) X-Inumbo-ID: b31107c2-0a26-11ea-a2db-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1574097192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fnczp/eF3UyJbsIgVIcl4ET7CKgMkGsOqy37uq5fk9Y=; b=SzFAldN4M5gvGTfj60XHeQdmFESGfBlPUTorMETnNnrBT5qnO07rOHpE 9FFnbHSGI6PVFDkiv9+/YMoWbRTu9K0ZFzQo1vW511qpc+FGWnBBHRdr9 Y7SkLl/ke3ISQMMy9CO5ES8O8vRIQxrEv+YyiDUjsg7Wg0u6TwhHOJGor Q=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.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 (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Not/o9/MWKXQSn/XCohsXADDyhLz8tsad28G+7pnHcazzscrMhwCdseTq17X5mUqXU2MSw8Qoz 2JzgjAvzybpbXWWyKMMdQcDluo8dAQOcBz9w2FoIV4jTRboSkR0FFuLOsd04LFZ7HAYUqQ6RlU OZRgkx2guHxOmT4BxuPuBGkhe+tFtkxsMunDzP2i4eoYRuCfU7uWZ3geX9qLqIrLBgxX4W812+ 8sOnX6At808hDlmyVk+Sbiisa842a4Bv4YtLV4rZaAJzBTMeShVBXkiW51nyunyShaqdBMQ79B LCE= X-SBRS: 2.7 X-MesageID: 8833204 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,320,1569297600"; d="scan'208";a="8833204" From: Anthony PERARD To: Date: Mon, 18 Nov 2019 17:13:03 +0000 Message-ID: <20191118171309.1459302-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191118171309.1459302-1-anthony.perard@citrix.com> References: <20191118171309.1459302-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH for-4.13 v3 2/7] libxl: Move libxl__ev_devlock declaration 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 , 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) We are going to want to include libxl__ev_devlock into libxl__ev_qmp. No functional changes. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- Notes: New patch in v2: Move of the struct was done in "libxl_qmp: Have a lock for QMP socket access" before. tools/libxl/libxl_internal.h | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 4e433e110664..69d572c1866a 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -363,6 +363,54 @@ struct libxl__ev_child { LIBXL_LIST_ENTRY(struct libxl__ev_child) entry; }; =20 +/* + * Lock for device hotplug, qmp_lock. + * + * libxl__ev_devlock implement a lock that is outside of CTX_LOCK in the + * lock hierarchy. It can be used when one want to make QMP calls to QEMU, + * which may take a significant amount time. + * It is to be acquired by an ao event callback. + * + * It is to be acquired when adding/removing devices or making changes + * to them when this is a slow operation and json_lock isn't appropriate. + * + * Possible states of libxl__ev_devlock: + * Undefined + * Might contain anything. + * Idle + * Struct contents are defined enough to pass to any + * libxl__ev_devlock_* function. + * The struct does not contain references to any allocated private + * resources so can be thrown away. + * Active + * Waiting to get a lock. + * Needs to wait until the callback is called. + * LockAcquired + * libxl__ev_devlock_unlock will need to be called to release the lock + * and the resources of libxl__ev_devlock. + * + * libxl__ev_devlock_init: Undefined/Idle -> Idle + * libxl__ev_devlock_lock: Idle -> Active + * May call callback synchronously. + * libxl__ev_devlock_unlock: LockAcquired/Idle -> Idle + * callback: When called: Active -> LockAcquired (on error: Idle) + * The callback is only called once. + */ +struct libxl__ev_devlock { + /* filled by user */ + libxl__ao *ao; + libxl_domid domid; + void (*callback)(libxl__egc *, libxl__ev_devlock *, int rc); + /* private to libxl__ev_devlock* */ + libxl__ev_child child; + char *path; /* path of the lock file itself */ + int fd; + bool held; +}; +_hidden void libxl__ev_devlock_init(libxl__ev_devlock *); +_hidden void libxl__ev_devlock_lock(libxl__egc *, libxl__ev_devlock *); +_hidden void libxl__ev_devlock_unlock(libxl__gc *, libxl__ev_devlock *); + /* * QMP asynchronous calls * @@ -4689,54 +4737,6 @@ static inline const char *libxl__qemu_qmp_path(libxl= __gc *gc, int domid) return GCSPRINTF("%s/qmp-libxl-%d", libxl__run_dir_path(), domid); } =20 -/* - * Lock for device hotplug, qmp_lock. - * - * libxl__ev_devlock implement a lock that is outside of CTX_LOCK in the - * lock hierarchy. It can be used when one want to make QMP calls to QEMU, - * which may take a significant amount time. - * It is to be acquired by an ao event callback. - * - * It is to be acquired when adding/removing devices or making changes - * to them when this is a slow operation and json_lock isn't appropriate. - * - * Possible states of libxl__ev_devlock: - * Undefined - * Might contain anything. - * Idle - * Struct contents are defined enough to pass to any - * libxl__ev_devlock_* function. - * The struct does not contain references to any allocated private - * resources so can be thrown away. - * Active - * Waiting to get a lock. - * Needs to wait until the callback is called. - * LockAcquired - * libxl__ev_devlock_unlock will need to be called to release the lock - * and the resources of libxl__ev_devlock. - * - * libxl__ev_devlock_init: Undefined/Idle -> Idle - * libxl__ev_devlock_lock: Idle -> Active - * May call callback synchronously. - * libxl__ev_devlock_unlock: LockAcquired/Idle -> Idle - * callback: When called: Active -> LockAcquired (on error: Idle) - * The callback is only called once. - */ -struct libxl__ev_devlock { - /* filled by user */ - libxl__ao *ao; - libxl_domid domid; - void (*callback)(libxl__egc *, libxl__ev_devlock *, int rc); - /* private to libxl__ev_devlock* */ - libxl__ev_child child; - char *path; /* path of the lock file itself */ - int fd; - bool held; -}; -_hidden void libxl__ev_devlock_init(libxl__ev_devlock *); -_hidden void libxl__ev_devlock_lock(libxl__egc *, libxl__ev_devlock *); -_hidden void libxl__ev_devlock_unlock(libxl__gc *, libxl__ev_devlock *); - /* Send control commands over xenstore and wait for an Ack. */ _hidden int libxl__domain_pvcontrol(libxl__egc *egc, libxl__xswait_state *pvcontrol, --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel