[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v3 07/38] block/quorum: Implement b
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted() |
Date: |
Thu, 04 Jun 2015 06:46:01 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
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 <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
>> ---
>
>> +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
- [Qemu-devel] [PATCH v3 04/38] block: Make bdrv_is_inserted() return a bool, (continued)
- [Qemu-devel] [PATCH v3 04/38] block: Make bdrv_is_inserted() return a bool, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 06/38] block: Make bdrv_is_inserted() recursive, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 08/38] block: Invoke change media CB before NULLing drv, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted(), Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 10/38] hw/usb-storage: Check whether BB is inserted, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 09/38] hw/block/fdc: Implement tray status, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 11/38] block: Fix BB AIOCB AioContext without BDS, Max Reitz, 2015/06/03