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
signature.asc
Description: OpenPGP digital signature