From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV0U7-0006vY-By for qemu-devel@nongnu.org; Fri, 10 Jun 2011 08:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QV0U6-0005c8-8t for qemu-devel@nongnu.org; Fri, 10 Jun 2011 08:06:43 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:57952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV0U6-0005bX-0H for qemu-devel@nongnu.org; Fri, 10 Jun 2011 08:06:42 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p5ABa9VK008442 for ; Fri, 10 Jun 2011 07:36:09 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5AC6LiV1138774 for ; Fri, 10 Jun 2011 08:06:23 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5AC6LCF000918 for ; Fri, 10 Jun 2011 09:06:21 -0300 From: "Aneesh Kumar K.V" In-Reply-To: <20110610103305.GD18497@redhat.com> References: <20110610103305.GD18497@redhat.com> Date: Fri, 10 Jun 2011 17:36:13 +0530 Message-ID: <87y619evre.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] QEMU 9pfs intentionally returning short reads ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org On Fri, 10 Jun 2011 11:33:05 +0100, "Daniel P. Berrange" wrote: > I've been doing some work trying to run QEMU guests with a root filesystem > exported from the host using virtio 9pfs. One of the issues that I have > discovered is that the 9p FS running on QEMU appears to cap all reads at > 4096 bytes[1]. Any larger read will return only partial data for plain > files. > But we should loop in kernel, requesting for multiple 9p request. kernel does size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; if (count > size) ret = v9fs_file_readn(filp, NULL, udata, count, *offset); else ret = p9_client_read(fid, NULL, udata, *offset, count); and v9fs_file_readn() does.. do { n = p9_client_read(fid, data, udata, offset, count); if (n <= 0) break; if (data) data += n; if (udata) udata += n; offset += n; count -= n; total += n; } while (count > 0 && n == size); I also did an strace of simple test and i see open("test", O_RDONLY) = 3 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8192) = 8192 -aneesh