All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uri Lublin <uril@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/2] qemu block changes: keep backing file format v2
Date: Wed, 28 Jan 2009 01:11:58 +0200	[thread overview]
Message-ID: <497F94BE.7060708@redhat.com> (raw)
In-Reply-To: <497F80B9.7070007@codemonkey.ws>

Anthony Liguori wrote:
> Uri Lublin wrote:
>> Jamie Lokier wrote:
>>> Uri Lublin wrote:
>>>> I call "hidden image format" to the following format of a backing 
>>>> file name:
>>>> "name\0format". Although it can be considered a hack, that's an easy
>>>> way to support old images with new qemu as well as old qemu with new 
>>>> images
>>>> (in which case probing would be done), without changing the qcow2 
>>>> header.
>>> ...
>>>> Changes from v1: use "name\0format" instead of "fmt:FMT:name"
>>>
>>> Do you think there will be any other information added in future,
>>> while wanting to remain compatible with old qemus (i.e. without
>>> changing the qcow2 header)?
>>>
>>> If so, "name\0format=FMT", and stop at the second \0 if there is one,
>>> something like that?
>>>
>>> -- Jamie
>>
>> I think you'd always want to keep the format of your backing file, so 
>> as long as
>> you keep the order of options fixed, it's safe (meaning we can add 
>> more options following the format, and there is no need to parse it).
>>
>> If we are thinking about ways to extend the simple "name\0options" 
>> format,
> 
> How about just extending the qcow2 header instead of playing ugly games 
> with the backing_file field?
> 

Would that be considered qcow3 ?

Shahar's extensions are following in the qcow2 header (without breaking existing 
images). I forgot to mention they are only implemented for qcow2 images.

Currently backing files are being opened in block.c:bdrv_open2(). If we want to 
do something specific to qcow2 (with regards to the backing file format), we'll 
need to leave bs->backing_file empty and open the backing file from 
block-qcow2.c:qcow_open(). Or we can add a backing_format field to struct 
BlockDriverState.

Regards,
     Uri.

>> Shahar Frank wrote a better, more extensible implementation, which 
>> saves image options as extensions following the qcow2-header. The 
>> options are saved in a binary format similar to the header. Each 
>> option has a little header of its own which includes magic(==type) and 
>> len.
>>
>> We (Shahar) also implemented a zero-cluster (aka zero-dedup) and would 
>> like,
>> in the future, to keep the offset of that cluster.
>>
>> If such an approach is acceptable, I can work on a patch implementing 
>> it (rebase and improve a bit Shahar's implementation).
>>
>> Thanks,
>>     Uri.

      reply	other threads:[~2009-01-27 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26 18:39 [Qemu-devel] [PATCH 0/2] qemu block changes: keep backing file format v2 Uri Lublin
2009-01-26 18:39 ` [Qemu-devel] [PATCH 1/2] Introducing hidden image format in backing file name Uri Lublin
2009-01-26 18:39   ` Uri Lublin
2009-01-26 18:39     ` [Qemu-devel] [PATCH 2/2] qemu-img: adding a "-F base_fmt" option to "qemu-img create -b" Uri Lublin
2009-01-26 21:56 ` [Qemu-devel] [PATCH 0/2] qemu block changes: keep backing file format v2 Jamie Lokier
2009-01-27 13:23   ` Uri Lublin
2009-01-27 21:46     ` Anthony Liguori
2009-01-27 23:11       ` Uri Lublin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=497F94BE.7060708@redhat.com \
    --to=uril@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.