From patchwork Mon Mar 20 18:19:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9634967 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 6CC0D602D6 for ; Mon, 20 Mar 2017 18:19:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6482026907 for ; Mon, 20 Mar 2017 18:19:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58FAD27C0B; Mon, 20 Mar 2017 18:19: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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 BFA9C26907 for ; Mon, 20 Mar 2017 18:19:51 +0000 (UTC) Received: from localhost ([::1]:34305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cq1uI-0006Y7-3T for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Mar 2017 14:19:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cq1ts-0006WX-46 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 14:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cq1tq-0007iu-3o for qemu-devel@nongnu.org; Mon, 20 Mar 2017 14:19:24 -0400 Received: from mail.kernel.org ([198.145.29.136]:46082) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cq1tp-0007iU-Qm for qemu-devel@nongnu.org; Mon, 20 Mar 2017 14:19:22 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2D7520386; Mon, 20 Mar 2017 18:19:19 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C18C120392; Mon, 20 Mar 2017 18:19:18 +0000 (UTC) From: Stefano Stabellini To: qemu-devel@nongnu.org Date: Mon, 20 Mar 2017 11:19:07 -0700 Message-Id: <1490033952-26735-3-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490033952-26735-1-git-send-email-sstabellini@kernel.org> References: <1490033952-26735-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH v4 3/8] xen/9pfs: introduce Xen 9pfs backend 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: jgross@suse.com, sstabellini@kernel.org, groug@kaod.org, Stefano Stabellini , "Aneesh Kumar K.V" , anthony.perard@citrix.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce the Xen 9pfs backend: add struct XenDevOps to register as a Xen backend and add struct V9fsTransport to register as v9fs transport. All functions are empty stubs for now. Signed-off-by: Stefano Stabellini Reviewed-by: Greg Kurz CC: anthony.perard@citrix.com CC: jgross@suse.com CC: Aneesh Kumar K.V CC: Greg Kurz --- hw/9pfs/xen-9p-backend.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 hw/9pfs/xen-9p-backend.c diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c new file mode 100644 index 0000000..960e690 --- /dev/null +++ b/hw/9pfs/xen-9p-backend.c @@ -0,0 +1,100 @@ +/* + * Xen 9p backend + * + * Copyright Aporeto 2017 + * + * Authors: + * Stefano Stabellini + * + */ + +#include "qemu/osdep.h" + +#include "hw/hw.h" +#include "hw/9pfs/9p.h" +#include "hw/xen/xen_backend.h" +#include "hw/xen/io/ring.h" +#include "qemu/config-file.h" +#include "fsdev/qemu-fsdev.h" +#include + +#define PAGE_SHIFT XC_PAGE_SHIFT +DEFINE_XEN_FLEX_RING_AND_INTF(xen_9pfs); + +typedef struct Xen9pfsDev { + struct XenDevice xendev; /* must be first */ +} Xen9pfsDev; + +static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu, + size_t offset, + const char *fmt, + va_list ap) +{ + return 0; +} + +static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu, + size_t offset, + const char *fmt, + va_list ap) +{ + return 0; +} + +static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu, + struct iovec **piov, + unsigned int *pniov) +{ +} + +static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, + struct iovec **piov, + unsigned int *pniov, + size_t size) +{ +} + +static void xen_9pfs_push_and_notify(V9fsPDU *pdu) +{ +} + +static const struct V9fsTransport xen_9p_transport = { + .pdu_vmarshal = xen_9pfs_pdu_vmarshal, + .pdu_vunmarshal = xen_9pfs_pdu_vunmarshal, + .init_in_iov_from_pdu = xen_9pfs_init_in_iov_from_pdu, + .init_out_iov_from_pdu = xen_9pfs_init_out_iov_from_pdu, + .push_and_notify = xen_9pfs_push_and_notify, +}; + +static int xen_9pfs_init(struct XenDevice *xendev) +{ + return 0; +} + +static int xen_9pfs_free(struct XenDevice *xendev) +{ + return -1; +} + +static int xen_9pfs_connect(struct XenDevice *xendev) +{ + return 0; +} + +static void xen_9pfs_alloc(struct XenDevice *xendev) +{ +} + +static void xen_9pfs_disconnect(struct XenDevice *xendev) +{ +} + +struct XenDevOps xen_9pfs_ops = { + .size = sizeof(Xen9pfsDev), + .flags = DEVOPS_FLAG_NEED_GNTDEV, + .alloc = xen_9pfs_alloc, + .init = xen_9pfs_init, + .initialise = xen_9pfs_connect, + .disconnect = xen_9pfs_disconnect, + .free = xen_9pfs_free, +};