From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LclHr-00021z-Ib for qemu-devel@nongnu.org; Thu, 26 Feb 2009 13:48:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LclHq-00021b-6z for qemu-devel@nongnu.org; Thu, 26 Feb 2009 13:48:47 -0500 Received: from [199.232.76.173] (port=58787 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LclHp-00021Y-Ui for qemu-devel@nongnu.org; Thu, 26 Feb 2009 13:48:45 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:57263) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LclHp-0001wU-IV for qemu-devel@nongnu.org; Thu, 26 Feb 2009 13:48:45 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n1QIkJ9n024975 for ; Thu, 26 Feb 2009 13:46:19 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n1QImg3G135936 for ; Thu, 26 Feb 2009 13:48:42 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n1QImfL2031587 for ; Thu, 26 Feb 2009 13:48:41 -0500 Message-ID: <49A6E409.4030607@us.ibm.com> Date: Thu, 26 Feb 2009 12:48:41 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] Introducing qcow2 extensions + keep backing file format (v4) References: <1234979501-9454-1-git-send-email-uril@redhat.com> <1234979501-9454-2-git-send-email-uril@redhat.com> In-Reply-To: <1234979501-9454-2-git-send-email-uril@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Uri Lublin wrote: > Qcow2 extensions are build of magic (id) len (in bytes) and data. > They reside between the end of the header and the filename. > > We can keep the backing file format in a such a qcow2 extension, to > 1. Provide a way to know the backing file format without probing > it (setting the format at creation time). > 2. Enable using qcow2 format over host block devices. > (only if the user specifically asks for it, by providing the format > at creation time). > > I've added bdrv_create2 and drv->bdrv_create2 (implemented only > by block-qcow2 currently) to pass the backing-format to create. > > Based on a work done by Shahar Frank. > > Also fixes a security flaw found by Daniel P. Berrange on [1] > which summarizes: "Autoprobing: just say no." > > [1] http://lists.gnu.org/archive/html/qemu-devel/2008-12/msg01083.html > > Signed-off-by: Uri Lublin > This made it through my regression testing but... > int bdrv_create(BlockDriver *drv, > const char *filename, int64_t size_in_sectors, > const char *backing_file, int flags) > @@ -348,6 +362,9 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, > > /* if there is a backing file, use it */ > bs1 = bdrv_new(""); > +/* if (drv) */ > +/* pstrcpy(bs1->backing_format, sizeof(bs->backing_format), */ > +/* drv->format_name); */ > I don't know if I missed this before or it was added since v3 but I'm curious why this is here and why it's commented out. Regards, Anthony Liguori