On 06/04/2015 06:37 AM, Alberto Garcia wrote: > On Wed 03 Jun 2015 09:43:48 PM CEST, Max Reitz wrote: >> bdrv_is_inserted() should be invoked recursively on the children of >> quorum. >> >> Signed-off-by: Max Reitz <mre...@redhat.com> >> Reviewed-by: Eric Blake <ebl...@redhat.com> >> --- > >> +static bool quorum_is_inserted(BlockDriverState *bs) >> +{ >> + BDRVQuorumState *s = bs->opaque; >> + int i; >> + >> + for (i = 0; i < s->num_children; i++) { >> + if (!bdrv_is_inserted(s->bs[i])) { >> + return false; >> + } >> + } >> + >> + return true; >> +} >> + > > I wonder if it can actually happen that only some of the BDS are > inserted :-?
Probably not possible while having a working quorum. But if I understand the series correctly, there may be windows of time when building up or hot-swapping a child within a quorum where things are not yet consistent, but where the code can query the current state of the quorum, so it's better to be prepared for those windows. And while unlikely, it is possible to build up a quorum that includes host cdrom passthrough or other scenario where one child can independently fail to be inserted. Who knows - we may even take advantage of this in COLO checkpointing where an NBD child is not yet inserted. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature