From patchwork Sun Jul 10 11:47: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: 9222579 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 73DD060572 for ; Sun, 10 Jul 2016 11:57:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6311D2434C for ; Sun, 10 Jul 2016 11:57:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55EFB264FB; Sun, 10 Jul 2016 11:57:52 +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 CAD652434C for ; Sun, 10 Jul 2016 11:57:51 +0000 (UTC) Received: from localhost ([::1]:54254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDMs-00006p-TV for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Jul 2016 07:57:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDDd-0005yA-0y for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMDDa-0001fT-SZ for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:16 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDDa-0001fG-Iy for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:14 -0400 Received: by mail-wm0-x243.google.com with SMTP id x83so11999146wma.3 for ; Sun, 10 Jul 2016 04:48: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=dN0Fx9QN1tzSDdpqoeVHsCs+MdFLDQKo8+Uu6wAEFLE=; b=lmqUKNNUhsy4lMZu/1pFXOWyaNavxODTfJ9mqDJmhIvz6kFlh1dBPDPFq5egfBu+xH KDjEePv7slKwqfBQqkbsHBvCUy/CJ75bZBiRdnk5NdtKjUsXD1JdMvVPYW28qOkNDZmp mgscz4t5JeR09DcL1nqz8OXOSpJmTGuKATDb8rYf9GBt5Zqk4io6wsDWCwaDcmUe63Sd WiHMVPdrlE/80xRsl8ZVIwWGheFV3OgEsDFrrbX9Ku1PzKZze9f+4q90EdlqMS26Ukr4 tcSQIbarY7hA1OV0CcpXFEjTJOyp8iHIxM0w6rULWg+qqztDuO15nL2izk7LeLO2A60c wZlw== 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=dN0Fx9QN1tzSDdpqoeVHsCs+MdFLDQKo8+Uu6wAEFLE=; b=BFM+6ocBIE5Q1eBlL/jU3s5Yyty++ks9n0AyRP7c1F6Akkw2/noZ6h7ZI7fWrJNYcg tFKRBMIVer1lS7VNLiaOttPetxOEusGp29Ep+m3DT3kPi2d5wDvNZkkUzaHMDFXtWwmi LdJH1inRTScD4/0u8XYi9j+lb/L4yr9+C9VGCQSRiCxed7xMJokCEo3pDSAA1s2Et2O6 nk9SqxdvHpqPVwohJRvzYQhaUGG89EBggb0JEKvF6wZP39qZV/FoBU5/ZArxomU1n1jd wz5dNG9A+F3N1d3UWQvTn5Af71U9azfonnhKjyO4WST5jvq7Zh5zi9IvciFJZVmYiHqT askA== X-Gm-Message-State: ALyK8tK/QGXl8VXOmapZN41eByNbcSaXA6pR9VT22fdIXSLg7/NbryVkIRZ9zwR6OIR/6A== X-Received: by 10.28.212.211 with SMTP id l202mr11987435wmg.6.1468151293867; Sun, 10 Jul 2016 04:48:13 -0700 (PDT) Received: from localhost.localdomain ([79.112.8.37]) by smtp.gmail.com with ESMTPSA id d137sm6888378wmd.12.2016.07.10.04.48.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Jul 2016 04:48:12 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Sun, 10 Jul 2016 14:47:35 +0300 Message-Id: <1468151270-12984-5-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468151270-12984-1-git-send-email-emilcondrea@gmail.com> References: <1468151270-12984-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::243 Subject: [Qemu-devel] [PATCH 04/19] 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: wei.liu2@citrix.com, stefanb@linux.vnet.ibm.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org, quan.xu@intel.com, dgdegra@tycho.nsa.gov, emilcondrea@gmail.com 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 | 37 +------------------------------------ hw/xen/xen_pvdev.c | 35 +++++++++++++++++++++++++++++++++++ include/hw/xen/xen_backend.h | 2 -- include/hw/xen/xen_pvdev.h | 4 ++++ 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index 0a9f9bb..5f2821a 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -561,25 +561,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) @@ -646,22 +627,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) { @@ -693,4 +658,4 @@ static void xenbe_register_types(void) type_register_static(&xensysdev_info); } -type_init(xenbe_register_types); +type_init(xenbe_register_types); \ No newline at end of file diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index 001fda2..7876724 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, const char *fmt, ... } 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 4832f79..60b634e 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen_backend.h @@ -29,8 +29,6 @@ int xen_be_init(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 cc49636..f269b04 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -66,6 +66,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);