From patchwork Mon Aug 7 08:53:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9884773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8386F60364 for ; Mon, 7 Aug 2017 08:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 777F6285D1 for ; Mon, 7 Aug 2017 08:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C55F285DC; Mon, 7 Aug 2017 08:56:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F16A285D1 for ; Mon, 7 Aug 2017 08:56:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dedo0-0005D2-8t; Mon, 07 Aug 2017 08:54:32 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dednz-0005Au-0r for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:54:31 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 44/CC-22472-6CA28895; Mon, 07 Aug 2017 08:54:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXiVRusrXtUqyP SYM1xDYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePxmYtMBb+5Ko4u38/awHiUs4uRi0NIYDqj RMPxp+wgDovAPGaJ/b17wRwJgX5WicefL7N0MXICOWkSDa03GCHsconOY6eYQGwhAS2Jo6dms 0KMamOS2HT0G1A3BwebgInErA4JkBoRASWJe6smM4HUMAvMZ5RomtTLBpIQFkiQOLNzEdhQFg FViWnnpoLZvAI+EgfuNDBBLJOTuHmukxnE5gSKn7/0hgVisbfE7WN9jBMYBRYwMqxi1ChOLSp LLdI1MtZLKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAgMrnoGBsYdjH17/Q4xSnIw KYnyxq9oixTiS8pPqcxILM6ILyrNSS0+xCjDwaEkwZug2REpJFiUmp5akZaZAwxzmLQEB4+SC O8LdaA0b3FBYm5xZjpE6hSjMcekA9u/MHG8mvD/G5MQS15+XqqUOO8bDaBSAZDSjNI8uEGw+L vEKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZg3DOQensy8Erh9r4BOYQI65U1iK8gpJYkIKak GRpVT9rcyy3/Ity/4U8n07MeX1/OfstYXL9gWPS+jZGV4v7FFrkqGz4LswicBM3Ilpu5kNNnD +1lGx7rkUqTXQ09bL5l67xKxkvzH9k8ecrVE7n7Ru63dxu+SwCcZDaF/W2WajTewlCXdvX1h3 4P4rkjBsmhz1QBR5i+WL+o+iMWv/5p7lmOyEktxRqKhFnNRcSIAnIZmmroCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-15.tower-31.messagelabs.com!1502096068!104821608!1 X-Originating-IP: [74.125.83.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52828 invoked from network); 7 Aug 2017 08:54:29 -0000 Received: from mail-pg0-f43.google.com (HELO mail-pg0-f43.google.com) (74.125.83.43) by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:54:29 -0000 Received: by mail-pg0-f43.google.com with SMTP id u5so31667309pgn.0 for ; Mon, 07 Aug 2017 01:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cCjDRmwTdHUYIQiYgejFMteqYI89juGj+je6V6CGGvI=; b=WXD9WVn56hgV+NZQqAJvcTDTWtYKr4iwtSnEKq++tEHPnVtbeqyElDgvP7u2J8RlXM bmNBlrxtWw1GCsFTgiu9sOgKefibSDjXHBt2tNM8+bCa+3Ij9vEsE3aAr/ylsjfNPu7i yBda73Fv9c5TTB7uqX6t7HkZILwxzx94LNeqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cCjDRmwTdHUYIQiYgejFMteqYI89juGj+je6V6CGGvI=; b=clntuZOA0XYQgJrRxYvdy9ZXU0nNLsd8g6k1ZXLa9jrB3o7vQoarj5Fl9AfC1WlbYd ua3xi+82hekBOndnDSvT/409HXf0vJOW71z0hLn+tpODzEW1uhx6XbGgVFXdb7FMV1/c gsBuCF0vI/VCvkscbIFQUgVf/AOQuD7rLq5iCCqsedst31P1ACkWhtvnxCxoIzuFDwb5 iVQyITY/Iasw/SXIdgCG0VcRiU1w9JV2EzCi2ndf58la7UHTVbJ3kfxTmXg93SID0jA/ sHH81bbIBlbHB5PPVhM6rHnusYyG4/tsRFEP5SRQ7/bInDOHVja0s1olcYVYNEWcdPkR uTtA== X-Gm-Message-State: AHYfb5jn5oS+orYReEmnZrvZL71bYxkX6zJM9rR6u8wdwBU1ddWTKP5r 805XVHgxBRZJQbFyFrea+g== X-Received: by 10.84.236.71 with SMTP id h7mr855428pln.348.1502096067705; Mon, 07 Aug 2017 01:54:27 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.54.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:54:27 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:23:12 +0530 Message-Id: <1502095997-31219-21-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 20/25 v7] xen/arm: vpl011: Add a new console_close_evtchn function in xenconsole X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a console_close_evtchn function. This function closes the console event channel. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v5: - Split this change in a separate patch. tools/console/daemon/io.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index cfd7273..71465a0 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -793,6 +793,14 @@ static void cleanup_domain(struct domain *d) remove_domain(d); } +static void console_close_evtchn(struct console *con) +{ + if (con->xce_handle != NULL) + xenevtchn_close(con->xce_handle); + + con->xce_handle = NULL; +} + static void shutdown_domain(struct domain *d) { struct console *con = &d->console; @@ -800,9 +808,7 @@ static void shutdown_domain(struct domain *d) d->is_dead = true; watch_domain(d, false); console_unmap_interface(con); - if (con->xce_handle != NULL) - xenevtchn_close(con->xce_handle); - con->xce_handle = NULL; + console_close_evtchn(con); } static unsigned enum_pass = 0;