From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <aliguori@linux.vnet.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Christoph Hellwig <hch@lst.de>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH v2 3/7] docs: Add QED image format specification
Date: Mon, 11 Oct 2010 17:47:37 +0200 [thread overview]
Message-ID: <4CB33199.407@redhat.com> (raw)
In-Reply-To: <4CB33030.3030909@linux.vnet.ibm.com>
On 10/11/2010 05:41 PM, Anthony Liguori wrote:
> On 10/11/2010 10:24 AM, Avi Kivity wrote:
>> On 10/11/2010 05:02 PM, Anthony Liguori wrote:
>>> On 10/11/2010 08:44 AM, Avi Kivity wrote:
>>>> On 10/11/2010 03:42 PM, Stefan Hajnoczi wrote:
>>>>> >
>>>>> > A leak is acceptable (it won't grow; it's just an unused,
>>>>> incorrect
>>>>> > freelist), but data corruption is not.
>>>>>
>>>>> The alternative is for the freelist to be a non-compat feature bit.
>>>>> That means older QEMU binaries cannot use a QED image that has
>>>>> enabled
>>>>> the freelist.
>>>>
>>>> For this one feature. What about others?
>>>
>>> A compat feature is one where the feature can be completely ignored
>>> (meaning that the QEMU does not have to understand the data format).
>>>
>>> An example of a compat feature is copy-on-read. It's merely a
>>> suggestion and there is no additional metadata. If a QEMU doesn't
>>> understand it, it doesn't affect it's ability to read the image.
>>>
>>> An example of a non-compat feature would be zero cluster entries.
>>> Zero cluster entries are a special L2 table entry that indicates
>>> that a cluster's on-disk data is all zeros. As long as there is at
>>> least 1 ZCE in the L2 tables, this feature bit must be set. As soon
>>> as all of the ZCE bits are cleared, the feature bit can be unset.
>>>
>>> An older QEMU will gracefully fail when presented with an image
>>> using ZCE bits. An image with no ZCEs will work on older QEMUs.
>>>
>>
>> What's the motivation behind ZCE?
>
> It's very useful for Copy-on-Read. If the cluster in the backing file
> is unallocated, then when you do a copy-on-read, you don't want to
> write out a zero cluster since you'd expand the image to it's maximum
> size.
>
> It's also useful for operations like compaction in the absence of
> TRIM. The common implementation on platforms like VMware is to open a
> file and write zeros to it until it fills up the filesystem. You then
> delete the file. The result is that any unallocated data on the disk
> is written as zero and combined with zero-detection in the image
> format, you can compact the image size by marking unallocated blocks
> as ZCE.
Both make sense. The latter is also useful with TRIM: if you have a
backing image it's better to implement TRIM with ZCE rather than
exposing the cluster from the backing file; it saves you a COW when you
later reallocate the cluster.
>
>> There is yet a third type of feature, one which is not strictly
>> needed in order to use the image, but if used, must be kept
>> synchronized. An example is the freelist. Another example is a
>> directory index for a filesystem. I can't think of another example
>> which would be relevant to QED -- metadata checksums perhaps? -- we
>> can always declare it a non-compatible feature, but of course, it
>> reduces compatibility.
>
> You're suggesting a feature that is not strictly needed, but that
> needs to be kept up to date. If it can't be kept up to date,
> something needs to happen to remove it. Let's call this a transient
> feature.
>
> Most of the transient features can be removed given some bit of code.
> For instance, ZCE can be removed by writing out zero clusters or
> writing an unallocated L2 entry if there is no backing file.
>
> I think we could add a qemu-img demote command or something like that
> that attempted to remove features when possible. That doesn't give
> you instant compatibility but I'm doubtful that you can come up with a
> generic way to remove a feature from an image without knowing anything
> about the image.
>
That should work, and in the worst case there is qemu-img convert (which
should be taught about format options).
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-10-11 15:47 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 15:48 [Qemu-devel] [PATCH v2 0/7] qed: Add QEMU Enhanced Disk format Stefan Hajnoczi
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 1/7] qcow2: Make get_bits_from_size() common Stefan Hajnoczi
2010-10-08 18:01 ` [Qemu-devel] " Anthony Liguori
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 2/7] cutils: Add bytes_to_str() to format byte values Stefan Hajnoczi
2010-10-11 11:09 ` [Qemu-devel] " Kevin Wolf
2010-10-13 9:15 ` [Qemu-devel] " Markus Armbruster
2010-10-13 9:28 ` Kevin Wolf
2010-10-13 10:58 ` Stefan Hajnoczi
2010-10-13 10:25 ` [Qemu-devel] " Avi Kivity
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 3/7] docs: Add QED image format specification Stefan Hajnoczi
2010-10-10 9:20 ` [Qemu-devel] " Avi Kivity
2010-10-11 10:09 ` Stefan Hajnoczi
2010-10-11 13:04 ` Avi Kivity
2010-10-11 13:42 ` Stefan Hajnoczi
2010-10-11 13:44 ` Avi Kivity
2010-10-11 14:06 ` Stefan Hajnoczi
2010-10-11 14:12 ` Avi Kivity
2010-10-11 15:02 ` Anthony Liguori
2010-10-11 15:24 ` Avi Kivity
2010-10-11 15:41 ` Anthony Liguori
2010-10-11 15:47 ` Avi Kivity [this message]
2010-10-11 14:54 ` Anthony Liguori
2010-10-11 14:58 ` Avi Kivity
2010-10-11 15:49 ` Anthony Liguori
2010-10-11 16:02 ` Avi Kivity
2010-10-11 16:10 ` Anthony Liguori
2010-10-12 10:25 ` Avi Kivity
2010-10-11 13:58 ` Kevin Wolf
2010-10-11 15:30 ` Stefan Hajnoczi
2010-10-11 15:39 ` Avi Kivity
2010-10-11 15:46 ` Stefan Hajnoczi
2010-10-11 16:18 ` Anthony Liguori
2010-10-11 17:14 ` Anthony Liguori
2010-10-12 8:07 ` Kevin Wolf
2010-10-12 13:16 ` Stefan Hajnoczi
2010-10-12 13:32 ` Anthony Liguori
2010-10-11 15:50 ` Kevin Wolf
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 4/7] qed: Add QEMU Enhanced Disk image format Stefan Hajnoczi
2010-10-11 15:16 ` [Qemu-devel] " Kevin Wolf
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 5/7] qed: Table, L2 cache, and cluster functions Stefan Hajnoczi
2010-10-12 14:44 ` [Qemu-devel] " Kevin Wolf
2010-10-13 13:41 ` Stefan Hajnoczi
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 6/7] qed: Read/write support Stefan Hajnoczi
2010-10-10 9:10 ` [Qemu-devel] " Avi Kivity
2010-10-11 10:37 ` Stefan Hajnoczi
2010-10-11 13:10 ` Avi Kivity
2010-10-11 13:55 ` Stefan Hajnoczi
2010-10-11 14:57 ` Anthony Liguori
2010-10-12 15:08 ` Kevin Wolf
2010-10-12 15:22 ` Anthony Liguori
2010-10-12 15:39 ` Kevin Wolf
2010-10-12 15:59 ` Stefan Hajnoczi
2010-10-12 16:16 ` Anthony Liguori
2010-10-12 16:21 ` Avi Kivity
2010-10-13 12:13 ` Stefan Hajnoczi
2010-10-13 13:07 ` Kevin Wolf
2010-10-13 13:24 ` Anthony Liguori
2010-10-13 13:50 ` Avi Kivity
2010-10-13 14:07 ` Stefan Hajnoczi
2010-10-13 14:08 ` Anthony Liguori
2010-10-13 14:10 ` Avi Kivity
2010-10-13 14:11 ` Anthony Liguori
2010-10-13 14:16 ` Avi Kivity
2010-10-13 14:53 ` Anthony Liguori
2010-10-13 15:08 ` Avi Kivity
2010-10-13 15:42 ` Anthony Liguori
2010-10-14 11:06 ` Stefan Hajnoczi
2010-10-13 14:10 ` Anthony Liguori
2010-10-08 15:48 ` [Qemu-devel] [PATCH v2 7/7] qed: Consistency check support Stefan Hajnoczi
2010-10-11 13:21 ` [Qemu-devel] Re: [PATCH v2 0/7] qed: Add QEMU Enhanced Disk format Kevin Wolf
2010-10-11 15:37 ` Stefan Hajnoczi
2010-10-16 7:51 ` [Qemu-devel] " Stefan Hajnoczi
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=4CB33199.407@redhat.com \
--to=avi@redhat.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).