[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] QEMU 9pfs intentionally returning short reads ?
From: |
Aneesh Kumar K.V |
Subject: |
Re: [Qemu-devel] QEMU 9pfs intentionally returning short reads ? |
Date: |
Fri, 10 Jun 2011 17:36:13 +0530 |
User-agent: |
Notmuch/0.5-215-g5143e5e (http://notmuchmail.org) Emacs/23.2.1 (i686-pc-linux-gnu) |
On Fri, 10 Jun 2011 11:33:05 +0100, "Daniel P. Berrange" <address@hidden> 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