From patchwork Tue Oct 25 05:50:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9394025 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 428FD60231 for ; Tue, 25 Oct 2016 05:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34B282935D for ; Tue, 25 Oct 2016 05:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 292D32935F; Tue, 25 Oct 2016 05:54:44 +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=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, 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 9616A2935D for ; Tue, 25 Oct 2016 05:54:42 +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 1byuee-0000kE-W9; Tue, 25 Oct 2016 05:52:08 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byued-0000jL-5X for xen-devel@lists.xen.org; Tue, 25 Oct 2016 05:52:07 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id 8F/BC-12614-603FE085; Tue, 25 Oct 2016 05:52:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRWlGSWpSXmKPExsXiVRvkrMv2mS/ CoP8Go8WSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvHpw2bGgnNKFWtfyzYwXpDpYuTiEBLoZ5T4 tn8TaxcjJweLwEsWiccNJiAJCYF+VokDkx4wgiQkBGIk7rT9Yuli5ACyqyT+fdEGCQsJqEjM+ 7GZCWLQD0aJqT/mMoMk2AS0JD4vX8MGYosISEr87joNFmcWuMUo8W5/JIgtLOAs8eLXI2aIxa oSGzbuBZvPK+Aq8WWXAsRaOYmTxyaD3cYp4CbxaMYJNoi9rhITmrezTmAUWMDIsIpRozi1qCy 1SNfIVC+pKDM9oyQ3MTNH19DAVC83tbg4MT01JzGpWC85P3cTIzCo6hkYGHcw7mr3O8QoycGk JMq77BxfhBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3jMfgXKCRanpqRVpmTnA8IZJS3DwKInwN oGkeYsLEnOLM9MhUqcYdTm2TL23lkmIJS8/L1VKnPc4SJEASFFGaR7cCFisXWKUlRLmZWRgYB DiKUgtys0sQZV/xSjOwagkzHsIZApPZl4J3KZXQEcwAR0hGM8DckRJIkJKqoFxqqyQZ7SPYbf Ea/ngF7OuJBp55it9S5G6/7guOf/W0auVkt0XrTkiXfqfHv/IbyxxTPVZr6NNH2thp+P+GMes F/4b5J+ef2b8o/TVc7FKtSunipJS96n/uPbvwiq5otYv0X+sgqvs864E3uDZb1vfu7UgMbG8h P/epysvGdvWB5dbR2oaP1RiKc5INNRiLipOBABBbXzPsAIAAA== X-Env-Sender: emilcondrea@gmail.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1477374725!66430474!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42853 invoked from network); 25 Oct 2016 05:52:06 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-8.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Oct 2016 05:52:06 -0000 Received: by mail-wm0-f67.google.com with SMTP id o81so263881wma.2 for ; Mon, 24 Oct 2016 22:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1/UFuawe+iQI4m+V1q6QqdhVijYmhdW4BDGJ9U210hM=; b=ELF2Zh6k15xo6QxcXK6HQhXAbtQD3grl2D7oDPnb6jrzzMEsJLzjKhlMhxyjGSRgzW kc1kZleUFv5l4Y3Lkw7+p0ZUC6R3XdRx53EcErxpzc5DwZAPbT4/kzuoDQ0hQ2LxFY4J iLcrYWJw6qjBvLNL1nhw0Y8eWq0JjBjcYFBbsgvaGNnvtzilYejDVwQIi8hG3UAndnd3 /gOB0g2WfATWbrA8lmXmz0uTUVwxjl6c3QNUw3Od51ENXUJReKRV735rtom1e0xKVGER DSZ1wsfd9etJ2iaH9xmHvUHgtJKfgln1d1+mGLpzuus7W0MOkoDEtq5KRenLOhamTSuh sygg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1/UFuawe+iQI4m+V1q6QqdhVijYmhdW4BDGJ9U210hM=; b=fIinm0/CkRMhWCYwmeWqZ7sKp/iMmMXDRTKGEx1bZjhdjOAS9FKtbyi1o6DclkEDN9 ane9EJhGvSGBsiyOcp2pFOgys4doSGtHc74TdIClRFoEWBBiKKNZKWNEycYguoDV2xq1 +3Yg/QeKfLcpSRawjH2eWtVh9bYx8BEqfYENwHJhR5DWdaYHitbwTrshrG89Bv94/tBz 8Vec7oHVdZIpU6PuaxXW6RZzGMCwQjUxJ+JI9kq8YoK+iUSYY2ymj5rgBagCqVcLVwws nUEJnLdeKUZ5xkTmP2aDLvEU9AzHqlYfpOpsksrW3z2/b1KBFXBnfPRkwNiivxd5aeeh HNmg== X-Gm-Message-State: ABUngveWbDrnkcN9cFXZ/5JG1A70sBWbOVzDaepbDbzPRkpvC7LnZ6v1qDdleDB2QtP+Hg== X-Received: by 10.194.17.197 with SMTP id q5mr14853224wjd.115.1477374725604; Mon, 24 Oct 2016 22:52:05 -0700 (PDT) Received: from localhost.localdomain ([79.112.79.134]) by smtp.gmail.com with ESMTPSA id gk6sm1358053wjc.21.2016.10.24.22.52.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 22:52:04 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 08:50:11 +0300 Message-Id: <1477374619-13149-6-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477374619-13149-1-git-send-email-emilcondrea@gmail.com> References: <1477374619-13149-1-git-send-email-emilcondrea@gmail.com> Cc: xuquan8@huawei.com, sstabellini@kernel.org, wei.liu2@citrix.com, stefanb@linux.vnet.ibm.com, xen-devel@lists.xen.org, anthony.perard@citrix.com, pbonzini@redhat.com, dgdegra@tycho.nsa.gov, eblake@redhat.com Subject: [Xen-devel] [PATCH v3 05/13] xen: Move evtchn functions to xen_pvdev.c 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 The name of the functions moved: * xen_be_evtchn_event * xen_be_unbind_evtchn * xen_be_send_notify Signed-off-by: Emil Condrea --- hw/xen/xen_backend.c | 35 ----------------------------------- hw/xen/xen_pvdev.c | 35 +++++++++++++++++++++++++++++++++++ include/hw/xen/xen_backend.h | 2 -- include/hw/xen/xen_pvdev.h | 4 ++++ 4 files changed, 39 insertions(+), 37 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index e3a7d95..1487db2 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -607,25 +607,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev) xen_be_frontend_changed(xendev, node); xen_be_check_state(xendev); } -static void xen_be_evtchn_event(void *opaque) -{ - struct XenDevice *xendev = opaque; - evtchn_port_t port; - - port = xenevtchn_pending(xendev->evtchndev); - if (port != xendev->local_port) { - xen_be_printf(xendev, 0, - "xenevtchn_pending returned %d (expected %d)\n", - port, xendev->local_port); - return; - } - xenevtchn_unmask(xendev->evtchndev, port); - - if (xendev->ops->event) { - xendev->ops->event(xendev); - } -} - /* -------------------------------------------------------------------- */ int xen_be_init(void) @@ -702,22 +683,6 @@ int xen_be_bind_evtchn(struct XenDevice *xendev) return 0; } -void xen_be_unbind_evtchn(struct XenDevice *xendev) -{ - if (xendev->local_port == -1) { - return; - } - qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL); - xenevtchn_unbind(xendev->evtchndev, xendev->local_port); - xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port); - xendev->local_port = -1; -} - -int xen_be_send_notify(struct XenDevice *xendev) -{ - return xenevtchn_notify(xendev->evtchndev, xendev->local_port); -} - static int xen_sysdev_init(SysBusDevice *dev) { diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 22a1abe..7607e44 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -171,3 +171,38 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level, } qemu_log_flush(); } + +void xen_be_evtchn_event(void *opaque) +{ + struct XenDevice *xendev = opaque; + evtchn_port_t port; + + port = xenevtchn_pending(xendev->evtchndev); + if (port != xendev->local_port) { + xen_be_printf(xendev, 0, + "xenevtchn_pending returned %d (expected %d)\n", + port, xendev->local_port); + return; + } + xenevtchn_unmask(xendev->evtchndev, port); + + if (xendev->ops->event) { + xendev->ops->event(xendev); + } +} + +void xen_be_unbind_evtchn(struct XenDevice *xendev) +{ + if (xendev->local_port == -1) { + return; + } + qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL); + xenevtchn_unbind(xendev->evtchndev, xendev->local_port); + xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port); + xendev->local_port = -1; +} + +int xen_be_send_notify(struct XenDevice *xendev) +{ + return xenevtchn_notify(xendev->evtchndev, xendev->local_port); +} diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h index 2e54150..6c617d9 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -36,8 +36,6 @@ void xen_be_register_common(void); int xen_be_register(const char *type, struct XenDevOps *ops); int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state); int xen_be_bind_evtchn(struct XenDevice *xendev); -void xen_be_unbind_evtchn(struct XenDevice *xendev); -int xen_be_send_notify(struct XenDevice *xendev); /* actual backend drivers */ extern struct XenDevOps xen_console_ops; /* xen_console.c */ diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 3c4cc01..a8da3da 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -64,6 +64,10 @@ void xenstore_update(void *unused); const char *xenbus_strstate(enum xenbus_state state); +void xen_be_evtchn_event(void *opaque); +void xen_be_unbind_evtchn(struct XenDevice *xendev); +int xen_be_send_notify(struct XenDevice *xendev); + void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...) GCC_FMT_ATTR(3, 4);