From: Eric Blake <eblake@redhat.com>
To: Fam Zheng <famz@redhat.com>, Liu Yuan <namei.unix@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Benoit Canet <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH] block/quorum: implement .bdrv_co_get_block_status
Date: Fri, 18 Jul 2014 06:14:03 -0600 [thread overview]
Message-ID: <53C90F8B.6070408@redhat.com> (raw)
In-Reply-To: <20140718031131.GB2478@T430.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]
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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-07-18 12:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 11:50 [Qemu-devel] [PATCH] block/quorum: implement .bdrv_co_get_block_status Liu Yuan
2014-07-18 3:11 ` Fam Zheng
2014-07-18 5:52 ` Liu Yuan
2014-07-18 11:10 ` Kevin Wolf
2014-07-18 12:14 ` Eric Blake [this message]
2014-07-18 13:35 ` Paolo Bonzini
2014-07-21 3:01 ` Liu Yuan
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=53C90F8B.6070408@redhat.com \
--to=eblake@redhat.com \
--cc=benoit@irqsave.net \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=namei.unix@gmail.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).