From patchwork Thu Oct 13 06:01:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9374411 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 0573260839 for ; Thu, 13 Oct 2016 06:07:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE33D29850 for ; Thu, 13 Oct 2016 06:07:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1CA02985C; Thu, 13 Oct 2016 06:07:22 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6633529850 for ; Thu, 13 Oct 2016 06:07:22 +0000 (UTC) Received: from localhost ([::1]:37790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buZAn-0003hI-Dw for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Oct 2016 02:07:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buZ5s-0008T8-ME for qemu-devel@nongnu.org; Thu, 13 Oct 2016 02:02:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buZ5r-0000Rb-HS for qemu-devel@nongnu.org; Thu, 13 Oct 2016 02:02:16 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buZ5r-0000RN-5p for qemu-devel@nongnu.org; Thu, 13 Oct 2016 02:02:15 -0400 Received: by mail-lf0-x244.google.com with SMTP id b75so10629836lfg.3 for ; Wed, 12 Oct 2016 23:02:14 -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=DTY5moe7uwH12dERp4V97ZIEra8B3GA9IQmp1INu/+IQA5uOcnVNmJq9lLbB8BVbMT Vj4zBz7UkHDBL7D3fkz1nM6BtNRo7IkCMDxBd8CGAUAG0YE46yysLsG4RsUsW53bGC9W 3hduM9zw2OmpW3xn677wpEfg0hLji4gbRKAEouu1H9uv6exTaKPmRfRV6ajkr1U9LFQu 4iQT9OvqmhTEuTAKAsG1unC3vn/9DGV/0ykNxjzGqP5zkHMy0Fhxhi/QCzoaeXtcpNnO y307daVXqssjYokEno5Vfvm6L4fZyufKGqk1BNBnp7N9rMgMxss0l73NzVH103Ybh+fS x9Aw== 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=f3Hdya4XfnFBZwg00nVU1QYFXFXpmFXh+E2k4pmJabbDm6cmqH6wgdG9QWNWSO6JZ6 C/Syr8q4JzRDtF+e7557nity+X2j2qSGzWI+aqEbhOvdGMaZStZh0CWpFpj2ahvGyWxb JRY653GbLsoEkC/kSdyS+57O53btp/7Wzsv3UZmGvhY8jqcbzHDyNdpSjk/kcH8WJkNN 2lKzQXZnVdrron4ossz6SSg9wzymjjDHKApUWCXacM+XUFrUkrkyQoLcSwFs+7TKlg8F iHpaA9ua7zgfeCinQLJFqxBVei9y6MZ7xySyQTi/RUfkDzG/WdIdaeYw+mh1sWHCZ1mK dJIQ== X-Gm-Message-State: AA6/9RnfT+gQBR3mc4CR5PEuA978dxjY2H/Rcj6RkRAUliPLtXU8GUCTgcNyDCoeDw2E7A== X-Received: by 10.194.19.130 with SMTP id f2mr5557783wje.107.1476338534308; Wed, 12 Oct 2016 23:02:14 -0700 (PDT) Received: from localhost.localdomain ([79.112.35.35]) by smtp.gmail.com with ESMTPSA id rv12sm19588230wjb.29.2016.10.12.23.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Oct 2016 23:02:13 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Thu, 13 Oct 2016 09:01:46 +0300 Message-Id: <1476338514-14492-6-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476338514-14492-1-git-send-email-emilcondrea@gmail.com> References: <1476338514-14492-1-git-send-email-emilcondrea@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PATCH v2 05/13] xen: Move evtchn functions to xen_pvdev.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, dgdegra@tycho.nsa.gov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-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);