qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] Introducing qcow2 extensions + keep backing


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/2] Introducing qcow2 extensions + keep backing file format (v4)
Date: Thu, 26 Feb 2009 12:48:41 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

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 <address@hidden>

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]