[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 18/21] qcow2: Add function for refcount order am
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 18/21] qcow2: Add function for refcount order amendment |
Date: |
Wed, 12 Nov 2014 13:21:52 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 11/12/2014 10:45 AM, Max Reitz wrote:
> On 2014-11-12 at 15:21, Max Reitz wrote:
>> On 2014-11-12 at 15:19, Eric Blake wrote:
>>> On 11/10/2014 06:45 AM, Max Reitz wrote:
>>>> Add a function qcow2_change_refcount_order() which allows changing the
>>>> refcount order of a qcow2 image.
>>> A thought: didn't you just submit a patch that marked the image as
>>> dirty, nuked the on-disk refcount, then rebuilt one using the in-memory
>>> refcounts? Would reusing THAT code be any better than writing this
>>> patch?
>>
>
> There are (at least) three problems with this approach. The first is a
> rather cosmetic one: You can't easily give progress reports. There are
> four time-consuming steps here (wiping references to the existing
> reftable is not time-consuming), so this approach can only say when 25 %
> are done, 50 %, 75 % and 100 %.
Yep, definitely annoying.
>
> The second is that if an error occurs during rebuilding the refcount
> structures, it's close to impossible to restore the old ones, because
> the new structures may have been partially written thus overwriting the
> old ones. But having marked the image dirty should suffice to "solve" this.
Solved, but not as clean as your current patch that maintains image
consistency throughout and doesn't require a rebuild. I guess a
tradeoff of clean images vs. code reuse can go either way.
>
> And the third one is that the initial check (whether the image is
> consistent at all) may throw an error because of refcount overflows.
> This error will tell you to use amend to increase the refcount width.
> Well, too bad. To solve this, we'd have to be able to do the refcount
> consistency check with an arbitrary refcount order (in this case the
> target refcount order), which would require some work on the check
> functions.
>
> I'll just go with the original idea for now.
Okay. Just making sure we are considering alternatives when justifying
why we go with a particular solution.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 17/21] qcow2: Use intermediate helper CB for amend, (continued)
[Qemu-devel] [PATCH 19/21] qcow2: Invoke refcount order amendment function, Max Reitz, 2014/11/10
[Qemu-devel] [PATCH 20/21] qcow2: Point to amend function in check, Max Reitz, 2014/11/10
[Qemu-devel] [PATCH 21/21] iotests: Add test for different refcount widths, Max Reitz, 2014/11/10