From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1glX-0006me-5l for qemu-devel@nongnu.org; Fri, 10 Jan 2014 13:25:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1glP-0003gi-SA for qemu-devel@nongnu.org; Fri, 10 Jan 2014 13:25:07 -0500 Received: from mail-ee0-f47.google.com ([74.125.83.47]:47189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1glP-0003gb-LY for qemu-devel@nongnu.org; Fri, 10 Jan 2014 13:24:59 -0500 Received: by mail-ee0-f47.google.com with SMTP id e51so1707216eek.6 for ; Fri, 10 Jan 2014 10:24:23 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52D03ACF.5020609@redhat.com> Date: Fri, 10 Jan 2014 19:24:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1388062130-21126-1-git-send-email-pl@kamp.de> <20140109141322.GB2862@dhcp-200-207.str.redhat.com> <52CEC998.4040409@kamp.de> <20140110114042.GB4276@dhcp-200-207.str.redhat.com> <52CFE396.7070802@kamp.de> <52CFE7C9.9060805@redhat.com> <52D00C4A.6010907@kamp.de> <20140110154614.GE4276@dhcp-200-207.str.redhat.com> <52D01B8D.6080100@kamp.de> <52D0365B.8070808@redhat.com> <027E51A1-36CF-4593-A0C2-88334723B9FE@kamp.de> In-Reply-To: <027E51A1-36CF-4593-A0C2-88334723B9FE@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv5] block: add native support for NFS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , "famz@redhat.com" , ronnie sahlberg , qemu-devel , Orit Wasserman , Stefan Hajnoczi Il 10/01/2014 19:07, Peter Lieven ha scritto: > > > > Von meinem iPad gesendet > > Am 10.01.2014 um 19:05 schrieb "Paolo Bonzini" : > >> Il 10/01/2014 18:16, ronnie sahlberg ha scritto: >>> >>> There is a common exception though, for the case where you read past >>> the end of file. >>> So short reads should normally not happen. Unless QEMU or the guest >>> sends a request to libnfs to read past the end of the file. >> >> Yes, this can happen in QEMU and the various drivers are careful to pad >> with zeroes. It could perhaps be moved to block.c, but for now each >> driver handles it separately. > > ok i will add this as well. however, i thought i had seen code for this in block.c already?, No, it corresponds to this code in block/raw-posix.c: static int aio_worker(void *arg) { RawPosixAIOData *aiocb = arg; ssize_t ret = 0; switch (aiocb->aio_type & QEMU_AIO_TYPE_MASK) { case QEMU_AIO_READ: ret = handle_aiocb_rw(aiocb); if (ret >= 0 && ret < aiocb->aio_nbytes && aiocb->bs->growable) { iov_memset(aiocb->aio_iov, aiocb->aio_niov, ret, 0, aiocb->aio_nbytes - ret); ret = aiocb->aio_nbytes; } if (ret == aiocb->aio_nbytes) { ret = 0; } else if (ret >= 0 && ret < aiocb->aio_nbytes) { ret = -EINVAL; } break; Paolo