From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLvog-00054l-Mz for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:09:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLvob-00051L-EG for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:09:21 -0400 Received: from [199.232.76.173] (port=47970 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLvob-00051C-7K for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:09:17 -0400 Received: from mx2.redhat.com ([66.187.237.31]:44996) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLvoa-00043c-Oq for qemu-devel@nongnu.org; Wed, 01 Jul 2009 05:09:17 -0400 Message-ID: <4A4B2777.3050303@redhat.com> Date: Wed, 01 Jul 2009 11:08:07 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block-raw: Allow pread beyond the end of growable images References: <1246038684-3702-1-git-send-email-kwolf@redhat.com> <20090630180940.GA4205@lst.de> <4A4B1238.8060302@redhat.com> <20090701085612.GA3564@lst.de> In-Reply-To: <20090701085612.GA3564@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig schrieb: > On Wed, Jul 01, 2009 at 09:37:28AM +0200, Kevin Wolf wrote: >> If you feel like posting a better patch, go ahead. I'm feeling that it's >> going to be a whole lot uglier in bdrv_pwrite, but that might prove >> wrong. And after all it is a problem with raw and not with the generic >> block code - qcow2 for example was already reading zeros. >> >> For the time being, this patch fixes a bug and should stay. > > So the only use case is a doing a savevm on a qcow2 device with a > raw-posix backing dev? What happens with nbd backing dev or a raw > backing dev on win32? OR (not sure we'll actually support that) another > image format backing dev? raw-win32 is actually a good question, I haven't tested that one. I think nbd is used as a protocol rather than the format. qcow1/2 should work, don't know for other formats like VMDK. What is biting us here is that nobody has ever specified what the block driver functions are supposed to do. They exist because they are in the struct, their parameters have names that give a rough idea about their meaning and that's it. Who cares about special cases? That said, while implementing the the fix in bdrv_pwrite is going to be ugly, we could do it in bdrv_read. Maybe this is the best approach. Kevin