From patchwork Wed Oct 30 18:07:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11219903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA6421390 for ; Wed, 30 Oct 2019 18:08:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 962FD2087E for ; Wed, 30 Oct 2019 18:08:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="VB9wEycN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 962FD2087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iPsNL-0003WM-Ox; Wed, 30 Oct 2019 18:07: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 1iPsNK-0003Vu-KL for xen-devel@lists.xenproject.org; Wed, 30 Oct 2019 18:07:18 +0000 X-Inumbo-ID: 166f0c6a-fb40-11e9-9534-12813bfff9fa Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 166f0c6a-fb40-11e9-9534-12813bfff9fa; Wed, 30 Oct 2019 18:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1572458829; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=P/tWRk2cOtLmXv60XzYIKvBrBGH4GRbB2zSPylTKM0U=; b=VB9wEycNOijacbC+opC6oAq736zLk1z9cZXpBNPtrm3wYgIquzIhy+iN Lr+1y5cd2PFBcwI1/4tmO8NDydpoAeSJIS0FVr73vkp9kyKlf0Tj5/ndn 4LJPNSVVSnxnQr28DncasOdZGA8CludtIr/ZIBtwH2g6NOAu1VMtHfJat Q=; Authentication-Results: esa1.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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 (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="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Tiz3CLHX1RmgY1rM08k31LitEJgdTRDT8ev81P6y5tpVRMrofnygERdGx5fAx+ljKXrNgsVEwZ UwF/2bt5rhSlia2uovKGySXkQEUrO5I/ELRlfgsWa2L5Xicm7c615Zn57fG1xV2l+aUjmE76ul hGrt6kS1U2+3OsAlkc4Iv+n0W4T5mTfRqQCzMKkyiEVRrkLGmOaAk13KQMlsMcN92EoH2fJ6Do nRU3NGf+OuQNz7O23YMNeGwe5zDvgz+ob1d4gWIKkyMtTLGYYulmvIA1Pbd9oeTbf5iOG4Y7zs wV4= X-SBRS: 2.7 X-MesageID: 7739500 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.68,248,1569297600"; d="scan'208";a="7739500" From: Anthony PERARD To: Date: Wed, 30 Oct 2019 18:07:02 +0000 Message-ID: <20191030180704.261320-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191030180704.261320-1-anthony.perard@citrix.com> References: <20191030180704.261320-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH for-4.13 v2 4/6] libxl: Introduce libxl__ev_slowlock_dispose 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 , =?utf-8?b?SsO8cmdlbiBHcm8=?= =?utf-8?b?w58=?= , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Which allow to cancel the lock operation while it is in Active state. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- Notes: v2: - Renamed libxl__ev_qmplock_dispose to libxl__ev_slowlock_dispose - This new API was part of the patch "Introduce libxl__ev_qmplock" in v1. tools/libxl/libxl_internal.c | 6 ++++++ tools/libxl/libxl_internal.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index 9520ac36149e..b2084157e4cd 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -765,6 +765,12 @@ void libxl__ev_slowlock_unlock(libxl__gc *gc, libxl__ev_slowlock *lock) ev_slowlock_init_internal(lock, lock->userdata_userid); } +void libxl__ev_slowlock_dispose(libxl__gc *gc, libxl__ev_slowlock *lock) +{ + libxl__ev_child_kill_deregister(lock->ao, &lock->child, SIGKILL); + libxl__ev_slowlock_unlock(gc, lock); +} + /* * Local variables: * mode: C diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index a0f99252c39c..9b84dddd3b7d 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -393,6 +393,8 @@ struct libxl__ev_child { * libxl__ev_slowlock_lock: Idle -> Active * May call callback synchronously. * libxl__ev_slowlock_unlock: LockAcquired/Idle -> Idle + * libxl__ev_slowlock_dispose: Idle/Active/LockAcquired -> Idle + * The callback will not be called anymore. * callback: When called: Active -> LockAcquired (on error: Idle) * The callback is only called once. */ @@ -411,6 +413,7 @@ struct libxl__ev_slowlock { _hidden void libxl__ev_devlock_init(libxl__ev_slowlock *); _hidden void libxl__ev_slowlock_lock(libxl__egc *, libxl__ev_slowlock *); _hidden void libxl__ev_slowlock_unlock(libxl__gc *, libxl__ev_slowlock *); +_hidden void libxl__ev_slowlock_dispose(libxl__gc *, libxl__ev_slowlock *); /* * QMP asynchronous calls