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: 9394059 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 EA29160231 for ; Tue, 25 Oct 2016 05:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBD862935F for ; Tue, 25 Oct 2016 05:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D099F29364; Tue, 25 Oct 2016 05:57:12 +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 5762C2935F for ; Tue, 25 Oct 2016 05:57:12 +0000 (UTC) Received: from localhost ([::1]:51903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byujX-0004mn-Ig for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 01:57:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byuee-0000wz-3N for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byuec-0004W4-Vu for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:08 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byuec-0004Vg-Pn for qemu-devel@nongnu.org; Tue, 25 Oct 2016 01:52:06 -0400 Received: by mail-wm0-x244.google.com with SMTP id d128so274307wmf.0 for ; Mon, 24 Oct 2016 22:52:06 -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=MD/1ukvWFf0yrcqqh2TKaErM83bXZCpGdlg8ugstGYBZ44hxhUiFfddkL/e0d/c1u+ SWoNdGnfFMs2a/Gk+a8GnNkqBZ1/xy1ZXFTT4fTtAN8ytwWcFO+fhIDjrDuwyLeXuLlG YH2jwMvBzuO8CzbqrExLvWFalILv3MGYB/aGF1caI+aFbCe6kfc3RxS/IZb8tGfkzOkA r5kn2anBI/WsYRMcuFSYHpdksUx7XDaW4CXyidJ2MTSfBe5XAis7ic0gOoetDoiQarQT C6PgJy1bRfJFRmVUTkCQgLE5Z4q/PqsUGMHyuy3ccZBQjDQ2Cgdqacsyzw/nZLIm/+ky h79w== X-Gm-Message-State: ABUngvfeHg0lpZO3CnX/vNnI6gheCOuM7dCGSOJ14hO14DQdChCGN5n4MiSmHUzzLjv6MA== 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v3 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, pbonzini@redhat.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);