qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block/quorum: implement .bdrv_co_get_block_stat


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] block/quorum: implement .bdrv_co_get_block_status
Date: Fri, 18 Jul 2014 06:14:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/17/2014 09:11 PM, Fam Zheng wrote:
> On Thu, 07/17 19:50, Liu Yuan wrote:
>> - allow drive-mirror to create sprase mirror on images like qcow2
>> - allow qemu-img map to work as expected on quorum driver
>>

>>  
>> +static int64_t coroutine_fn quorum_co_get_block_status(BlockDriverState *bs,
>> +                                                       int64_t sector_num,
>> +                                                       int nb_sectors,
>> +                                                       int *pnum)
>> +{
>> +    BDRVQuorumState *s = bs->opaque;
>> +    BlockDriverState *child_bs = s->bs[0];
> 
> Should we consider other children?

Yes. Just because the children are written identically from the guest
point of view does not mean they start identically mapped, only that
they start with identical guest-visible contents.  In particular, a
quorum is allowed to be composed of disparate children (I could have a
quorum between a raw, a qcow2 v0.10, and a qcow2 v1.1 - and those three
formats have DIFFERENT notions of whether block_status can report
sparse, even for the same guest contents), or even where one child is a
chain of images while the other is flat.

For this function, I'm not sure you need a full quorum to declare a
block sparse, but you definitely need to consider that the first child
might not report sparse while later children do.  In other words, you
need to come up with some sane pattern that collapses information from
all children into a reliable answer for the quorum as a whole (probably
okay if any one child declares a sector as sparse to say the quorum is
sparse).  Likewise, you cannot assume that all the children have the
same number of consecutive sectors in the same allocated condition; even
though you can still come up with a reliable number for the quorum
(probably the minimum of the numbers reported by each child).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]