[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Introducing qcow2 extensions + keep backing
Re: [Qemu-devel] [PATCH 1/2] Introducing qcow2 extensions + keep backing file format (v4)
Thu, 26 Feb 2009 12:48:41 -0600
Thunderbird 188.8.131.52 (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 
which summarizes: "Autoprobing: just say no."
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,
/* 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.