From patchwork Mon May 21 19:34:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 10416249 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 6322B6032C for ; Mon, 21 May 2018 19:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52DDC289F6 for ; Mon, 21 May 2018 19:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4766D289FF; Mon, 21 May 2018 19:42: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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 66EE128A4F for ; Mon, 21 May 2018 19:41:56 +0000 (UTC) Received: from localhost ([::1]:52172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKqgt-0006M5-FL for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 May 2018 15:41:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKqaO-0000fN-W1 for qemu-devel@nongnu.org; Mon, 21 May 2018 15:35:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKqaM-0003Ez-Ty for qemu-devel@nongnu.org; Mon, 21 May 2018 15:35:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:60296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fKqaM-0003DH-Oo for qemu-devel@nongnu.org; Mon, 21 May 2018 15:35:10 -0400 Received: from sstabellini-ThinkPad-X260.xilinx.com (unknown [149.199.62.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD3E220875; Mon, 21 May 2018 19:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526931310; bh=x1x3KuRo0iLwnvoX04jmiazPzUD4LoJTWvSkHgzsMAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9I8aTur4aaAdRFTx0lBtSjmexrHl+9W5S+cbLg0hYW3ezH/hpZoxVA2A0z5iQ6Dn sRHCnfIwQG0mWOXnkFf4TpVbD8s6WDuTY0ZtPv1SI8AO0rL02SLgmINjtIXfig2bdS +YjeJlfHZACIti35Mo6qOUd/1rBjtAqJW0dco58w= From: Stefano Stabellini To: peter.maydell@linaro.org, stefanha@gmail.com Date: Mon, 21 May 2018 12:34:56 -0700 Message-Id: <1526931304-7289-7-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.145.29.99 Subject: [Qemu-devel] [PULL 07/15] xen: add a meaningful declaration of grant_copy_segment into xen_common.h 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: sstabellini@kernel.org, qemu-devel@nongnu.org, Paul Durrant , stefanha@redhat.com, anthony.perard@citrix.com, xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Paul Durrant Currently the xen_disk source has to carry #ifdef exclusions to compile against Xen older then 4.8. This is a bit messy so this patch lifts the definition of struct xengnttab_grant_copy_segment and adds it into the pre-4.8 compat area in xen_common.h, which allows xen_disk to be cleaned up. Signed-off-by: Paul Durrant Acked-by: Anthony PERARD Signed-off-by: Stefano Stabellini --- hw/block/xen_disk.c | 18 ------------------ include/hw/xen/xen_common.h | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index f74fcd4..78bfb41 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -496,8 +496,6 @@ static int ioreq_map(struct ioreq *ioreq) return 0; } -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800 - static void ioreq_free_copy_buffers(struct ioreq *ioreq) { int i; @@ -579,22 +577,6 @@ static int ioreq_grant_copy(struct ioreq *ioreq) return rc; } -#else -static void ioreq_free_copy_buffers(struct ioreq *ioreq) -{ - abort(); -} - -static int ioreq_init_copy_buffers(struct ioreq *ioreq) -{ - abort(); -} - -static int ioreq_grant_copy(struct ioreq *ioreq) -{ - abort(); -} -#endif static int ioreq_runio_qemu_aio(struct ioreq *ioreq); diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 5f1402b..bbf207d 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -667,8 +667,21 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref, #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800 - -typedef void *xengnttab_grant_copy_segment_t; +struct xengnttab_grant_copy_segment { + union xengnttab_copy_ptr { + void *virt; + struct { + uint32_t ref; + uint16_t offset; + uint16_t domid; + } foreign; + } source, dest; + uint16_t len; + uint16_t flags; + int16_t status; +}; + +typedef struct xengnttab_grant_copy_segment xengnttab_grant_copy_segment_t; static inline int xengnttab_grant_copy(xengnttab_handle *xgt, uint32_t count, xengnttab_grant_copy_segment_t *segs)