From patchwork Mon Nov 21 21:39:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9440087 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 519E1606DB for ; Mon, 21 Nov 2016 21:41:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45332289B2 for ; Mon, 21 Nov 2016 21:41:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37DF9289E0; Mon, 21 Nov 2016 21:41:46 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9A4028A32 for ; Mon, 21 Nov 2016 21:41:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8wJV-0007T5-31; Mon, 21 Nov 2016 21:39:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8wJT-0007SD-Vk for xen-devel@lists.xensource.com; Mon, 21 Nov 2016 21:39:44 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id E6/01-01948-F9963385; Mon, 21 Nov 2016 21:39:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVybKJsh+68TOM Ig1u9Ohb3prxnd2D02N63iz2AMYo1My8pvyKBNaN323/WgmkCFfM3yzYwnuPpYuTiEBKYyijR t3cxO4SznUni2quHQA4nB5uAocTfJ5vYQGwRAWWJpsk9bCBFzCAddzrOgyWEBVwklmw+zApis wioSlz7cZ0RxOYVcJN4fP0HC4gtISAncfLYZLAaTgF3iZXHJjNBbGtjlJh1dQJUUYbEvJ45rB C2l8SiG5egbDWJq+c2MU9g5FvAyLCKUb04tagstUjXXC+pKDM9oyQ3MTNH19DAVC83tbg4MT0 1JzGpWC85P3cTIzBQGIBgB+Oxyc6HGCU5mJREeQ8vNYoQ4kvKT6nMSCzOiC8qzUktPsQow8Gh JME7LcM4QkiwKDU9tSItMwcYsjBpCQ4eJRFeG5A0b3FBYm5xZjpE6hSjopQ4bztIQgAkkVGaB 9cGi5NLjLJSwryMQIcI8RSkFuVmlqDKv2IU52BUEuZtA5nCk5lXAjf9FdBiJqDFSqwGIItLEh FSUg2MojExgql3Sk6rPz+aO20+xwJDN56QVTJL7t08f7nTrKj6+50KhbN1L+Okq+IiD0W5Nj1 gPn83iGtt4plDQV6+v02VbE8nvYo/pjrVP0fKe9eEOob/DjGsf8zem0ayiLimmGrtScn/fqLi fJ7U3vp9j5r2WH7cIz6v2J31cmjOhGcbr3dn1ExRYinOSDTUYi4qTgQA5YPpzI4CAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1479764380!57710622!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58030 invoked from network); 21 Nov 2016 21:39:41 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-15.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Nov 2016 21:39:41 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58A1E20220; Mon, 21 Nov 2016 21:39:40 +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 AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C8BFA200E7; Mon, 21 Nov 2016 21:39:38 +0000 (UTC) From: Stefano Stabellini To: aneesh.kumar@linux.vnet.ibm.com Date: Mon, 21 Nov 2016 13:39:32 -0800 Message-Id: <1479764372-29470-4-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479764372-29470-1-git-send-email-sstabellini@kernel.org> References: <1479764372-29470-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com, groug@kaod.org, qemu-devel@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com Subject: [Xen-devel] [PATCH 4/4] 9pfs: add a size parameter to init_iov_from_pdu X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Not all 9pfs transports share memory between request and response. For those who don't, it is necessary to know how much memory is required in the response. Signed-off-by: Stefano Stabellini --- hw/9pfs/9p.c | 2 +- hw/9pfs/9p.h | 2 +- hw/9pfs/virtio-9p-device.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index b6ec042..b82212b 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1652,7 +1652,7 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, struct iovec *iov; unsigned int niov; - pdu->s->transport->init_iov_from_pdu(pdu, &iov, &niov, is_write); + pdu->s->transport->init_iov_from_pdu(pdu, &iov, &niov, is_write, skip + size); qemu_iovec_init_external(&elem, iov, niov); qemu_iovec_init(qiov, niov); diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index ab398d0..c830188 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -348,7 +348,7 @@ struct V9fsTransport { ssize_t (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap); ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap); void (*init_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, bool is_write); + unsigned int *pniov, bool is_write, size_t size); void (*push_and_notify)(V9fsPDU *pdu); }; diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index e1a37a4..e2b27e8 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -172,7 +172,7 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, } static void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, bool is_write) + unsigned int *pniov, bool is_write, size_t size) { V9fsState *s = pdu->s; V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);