From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYG9n-0007r2-4b for qemu-devel@nongnu.org; Wed, 07 Dec 2011 06:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYG9i-0002FM-78 for qemu-devel@nongnu.org; Wed, 07 Dec 2011 06:59:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYG9h-0002FH-Ln for qemu-devel@nongnu.org; Wed, 07 Dec 2011 06:59:22 -0500 Message-ID: <4EDF55D6.9030007@redhat.com> Date: Wed, 07 Dec 2011 13:02:30 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1323258319-21220-1-git-send-email-kwolf@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-img rebase: Fix for undersized backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Am 07.12.2011 12:50, schrieb Stefan Hajnoczi: > On Wed, Dec 7, 2011 at 11:45 AM, Kevin Wolf wrote: >> Backing files may be smaller than the corresponding COW file. When >> reading directly from the backing file, qemu-img rebase must consider >> this and assume zero sectors after the end of backing files. >> >> Signed-off-by: Kevin Wolf >> --- >> qemu-img.c | 42 +++++++++++++++++++++++++++++++++--------- >> 1 files changed, 33 insertions(+), 9 deletions(-) > > Reviewed-by: Stefan Hajnoczi > > It almost feels like we want a bdrv_read() variation that does the > zeroing beyond end of image instead of duplicating this. Almost. If we have a third user, it's probably worth it. Actually, if we make a bdrv_co_readv_backing() instead of a synchronous one, qcow2 would be the third user (and maybe VMDK could use it, too). That would require moving qemu-img into a coroutine first, which I think you wanted to do anyway? Kevin