From patchwork Tue Oct 4 06:43:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9361233 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 F2E7D600C8 for ; Tue, 4 Oct 2016 06:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1846287AA for ; Tue, 4 Oct 2016 06:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D637128A3D; Tue, 4 Oct 2016 06:54:14 +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 4F30628843 for ; Tue, 4 Oct 2016 06:54:14 +0000 (UTC) Received: from localhost ([::1]:40478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJcD-0000Zq-8r for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Oct 2016 02:54:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJSx-0001kC-DO for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brJSu-0005jJ-Kn for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:38 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brJSu-0005iW-97 for qemu-devel@nongnu.org; Tue, 04 Oct 2016 02:44:36 -0400 Received: by mail-wm0-x241.google.com with SMTP id b184so18028200wma.3 for ; Mon, 03 Oct 2016 23:44:36 -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=5QGrtuTp0T0MHwkCLNdM7Z4lPm4/B+suaHgTaLVMIqQ=; b=bgypLXva5paSzWQkvNlmG3tfFjpanwzZGbphhPXozp0WbG882bbUJFaV0VFhGCsbKp 4lniHWPKE4lw5Aa/D7TYDJJM8h/iTdYy9oLSgWOWtVILfqslrn+LQs/VSwJ9E/nDjKJw v4QHCaTi49s3hdNZ+orFKRvNww8XCPsEtwxe0AJ+bPVkgJJmOCNRM3CZW2l1XPWQiomG 9YXir1PPtb3XR9g1ISYbid/u5YNTcX/gNryLTIj4P9+8JYCzVzJEHO3H1ZmIBCRfqp5C 5WB11KWFx9+Sc3mW6abh0DEhNaWcC7hZM7DHCpqyZKVKl7QeUh4Er+AOnn4/HToKphUa I5vA== 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=5QGrtuTp0T0MHwkCLNdM7Z4lPm4/B+suaHgTaLVMIqQ=; b=ODjFwZE9MZm41imvRXmeeIpihAKpfrCT47vTTO7Ur/UMPZ0P98jsQ23Ivhu0OSGxxo Svw7ePe6TLSg3QND/iJQ9AbOLhgUZdLuI5BJ9oc5AlO3ZmPISJeISEqtEtrmOTAwnMwz qQ2wX7Mnr6SlXpn9JJ2VWffm0f11DbECNQ8MDSDpcRUcPkXR/bw6/IGEpYMoCca6rHc2 /Mpv5MWyOvTMg2ZaTojcXxYYbAUG+LQ0Up1h6gv3FDTgCNTknTkLXiEMMbto5+i9OCm5 YBCKnLC5aG0PEVsIxqF94PYB9OtaBgIyRC6nWlmVpAuN3dOEdxufDpOHx5ZgzhkjpsBz XYyA== X-Gm-Message-State: AA6/9RkKU8dUFGZP6gumTcpV5mM0StjdWucEdX/ry1JXZ2Xurptu/Q1LTo9cfg5Fy0tLSw== X-Received: by 10.28.87.212 with SMTP id l203mr12331010wmb.71.1475563475276; Mon, 03 Oct 2016 23:44:35 -0700 (PDT) Received: from localhost.localdomain ([79.112.35.35]) by smtp.gmail.com with ESMTPSA id f142sm2341423wmf.19.2016.10.03.23.44.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Oct 2016 23:44:34 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Tue, 4 Oct 2016 09:43:35 +0300 Message-Id: <1475563424-6604-7-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475563424-6604-1-git-send-email-emilcondrea@gmail.com> References: <1475563424-6604-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:400c:c09::241 Subject: [Qemu-devel] [PATCH 06/15] 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, Emil Condrea 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 6b03c50..c7db068 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -543,25 +543,6 @@ void xenstore_update_be(char *watch, char *type, int dom, } } -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) @@ -638,22 +619,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 35d3be6..91101fd 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -172,3 +172,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 965a39a..d0dbee5 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -31,8 +31,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 3a9a4a4..cf44a87 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);