From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRl54-0001wZ-3v for qemu-devel@nongnu.org; Fri, 17 Jul 2009 06:54:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRl4z-0001is-9U for qemu-devel@nongnu.org; Fri, 17 Jul 2009 06:54:21 -0400 Received: from [199.232.76.173] (port=55614 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRl4z-0001ie-4z for qemu-devel@nongnu.org; Fri, 17 Jul 2009 06:54:17 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46138) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRl4y-00061G-JL for qemu-devel@nongnu.org; Fri, 17 Jul 2009 06:54:16 -0400 Message-ID: <4A60580D.40905@redhat.com> Date: Fri, 17 Jul 2009 12:53:01 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] vmdk: Fix backing file handling References: <1247811641-10235-1-git-send-email-kwolf@redhat.com> <20090717103438.GA6729@lst.de> In-Reply-To: <20090717103438.GA6729@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 Fri, Jul 17, 2009 at 08:20:41AM +0200, Kevin Wolf wrote: >> Instead of storing the backing file in its own BlockDriverState, VMDK uses the >> BlockDriverState of the raw image file it opened. This is wrong and breaks >> functions that access the backing file or protocols. This fix replaces all >> occurrences of s->hd->backing_* with bs->backing_*. >> >> This fixes qemu-iotests failure in 020 (Commit changes to backing file). > > Wow, that's an interesting one. Looks good to me. Yup, definitely interesting. And it wasn't even consequently wrong: vmdk_close already used bs->backing_hd. > Btw, the vmdk seems to assume the backing_hd always is a vmdk image, > too. I'm not sure if it is a good assumption. While the backing_hd is > found following the parentFileNameHint field in the image there's > nothing preventing a user / admin from having a different kind of image > in that place. Oh, does it? I haven't looked much at it, the fix for the failing test was so obvious. Only supporting vmdk as backing file might be debatable (probably still a bad idea), but if it allows creation of different combination but can't handle them, it's clearly a bug. I guess we should have a qemu-iotests case for using different image formats as backing file. Kevin