[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 03/14] quorum: ignore 0-length child
From: |
Wen Congyang |
Subject: |
Re: [Qemu-devel] [RFC PATCH 03/14] quorum: ignore 0-length child |
Date: |
Tue, 24 Feb 2015 10:33:28 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 02/24/2015 04:43 AM, Max Reitz wrote:
> On 2015-02-11 at 22:07, Wen Congyang wrote:
>> We connect to NBD server when starting block replication, so
>> the length is 0 before starting block replication.
>>
>> Signed-off-by: Wen Congyang <address@hidden>
>> Signed-off-by: zhanghailiang <address@hidden>
>> Signed-off-by: Gonglei <address@hidden>
>> ---
>> block/quorum.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/block/quorum.c b/block/quorum.c
>> index 5ed1ff8..e6aff5f 100644
>> --- a/block/quorum.c
>> +++ b/block/quorum.c
>> @@ -734,6 +734,11 @@ static int64_t quorum_getlength(BlockDriverState *bs)
>> if (value < 0) {
>> return value;
>> }
>> +
>> + if (!value) {
>> + continue;
>> + }
>> +
>> if (value != result) {
>> return -EIO;
>> }
>
> Hm, what do you think about some specific error value returned by your
> delayed NBD implementation? Like -ENOTCONN or something like that? Then we'd
> be able to discern a real 0-length block device from a not-yet-connected NBD
> server.
>
> Also, while you did write that one shouldn't be using the NBD client as the
> first quorum child, I think we should try to support that case anyway. For
> this patch, that means accepting that bdrv_getlength(s->bs[0]) may be off.
Good idea. I will try it.
Thanks
Wen Congyang
>
> Max
> .
>
[Qemu-devel] [RFC PATCH 04/14] Add new block driver interfaces to control disk replication, Wen Congyang, 2015/02/11
[Qemu-devel] [RFC PATCH 03/14] quorum: ignore 0-length child, Wen Congyang, 2015/02/11
[Qemu-devel] [RFC PATCH 05/14] quorom: implement block driver interfaces for block replication, Wen Congyang, 2015/02/11
[Qemu-devel] [RFC PATCH 06/14] NBD client: connect to nbd server later, Wen Congyang, 2015/02/11
[Qemu-devel] [RFC PATCH 09/14] block: give backing image its own BlockBackend, Wen Congyang, 2015/02/11
[Qemu-devel] [RFC PATCH 07/14] NBD client: implement block driver interfaces for block replication, Wen Congyang, 2015/02/11