qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qcow2: Implement bdrv_amend_options
Date: Thu, 29 Aug 2013 14:52:12 +0200	[thread overview]
Message-ID: <521F43FC.1060604@redhat.com> (raw)
In-Reply-To: <521F425D.5030400@redhat.com>

Am 29.08.2013 14:45, schrieb Eric Blake:
> On 08/29/2013 05:20 AM, Max Reitz wrote:
>> Implement bdrv_amend_options for compat, size, backing_file, backing_fmt
>> and lazy_refcounts.
>>
>> Downgrading images from compat=1.1 to compat=0.10 is achieved through
>> handling all incompatible flags accordingly, clearing all compatible and
>> autoclear flags and expanding all zero clusters.
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>> +/*
>> + * Expands all zero clusters on the image; important for downgrading to a qcow2
>> + * version which doesn't yet support metadata zero clusters.
> Do we have to fully write 0 blocks into the image no matter what, or are
> there cases where, when the file has a backing image and we know the
> backing image has 0 bytes at the same offset, where we could flatten by
> removing the cluster and letting the reference defer to the backing
> file?  It's always safer to write 0 blocks into this image, but it may
> be worth considering whether we need the (ability) to try the alternate
> method as it results in a smaller file and potentially faster conversion.
This seems non-trivial to optimize to me (at least doing that check 
fast), at least too non-trivial for implementing it solely for an image 
version downgrade (which nobody who is concerned about image size should 
do anyway, imho).

For non-backed images however, we could certainly just unallocate the 
blocks, I guess, since the spec explicitly states for that case that "if 
a cluster is unallocated, read requests […] shall read zeros for all 
parts that are not covered by the backing file" (also applies if there 
is no backing file at all).

>> +
>> +    /* the refcount order might be different in newer images - however, qemu
>> +     * doesn't support anything different than 4 anyway, so nothing to fix
>> +     * there */
> This sounds risky.  Wouldn't it be safer to error out if the image
> didn't have a refcount order of 4, than to just ignore it; on the
> grounds that if qemu DOES add support for non-4 refcount order, an error
> will at least alert someone to the fact that they need to add some
> (potentially complicated) code here?
>
Oh, yes, of course. I'll fix it.


Max

  reply	other threads:[~2013-08-29 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 11:20 [Qemu-devel] [PATCH v2 0/3] block/qcow2: Image file option amendment Max Reitz
2013-08-29 11:20 ` [Qemu-devel] [PATCH v2 1/3] block: " Max Reitz
2013-08-29 12:38   ` Eric Blake
2013-08-29 12:40     ` Max Reitz
2013-08-29 11:20 ` [Qemu-devel] [PATCH v2 2/3] qcow2: Implement bdrv_amend_options Max Reitz
2013-08-29 12:45   ` Eric Blake
2013-08-29 12:52     ` Max Reitz [this message]
2013-08-29 13:00       ` Kevin Wolf
2013-08-29 11:20 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotest: qcow2 image option amendment Max Reitz

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=521F43FC.1060604@redhat.com \
    --to=mreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).