qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Patch for-2.5 v2 3/6] Add new block driver interface t


From: Wen Congyang
Subject: Re: [Qemu-devel] [Patch for-2.5 v2 3/6] Add new block driver interface to add/delete a BDS's child
Date: Tue, 1 Sep 2015 08:44:47 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 09/01/2015 01:40 AM, Eric Blake wrote:
> On 08/11/2015 01:51 AM, Wen Congyang wrote:
>> In some cases, we want to take a quorum child offline, and take
>> another child online.
>>
>> Signed-off-by: Wen Congyang <address@hidden>
>> Signed-off-by: zhanghailiang <address@hidden>
>> Signed-off-by: Gonglei <address@hidden>
>> Reviewed-by: Alberto Garcia <address@hidden>
>> ---
>>  block.c                   | 43 +++++++++++++++++++++++++++++++++++++++++++
>>  include/block/block.h     |  4 ++++
>>  include/block/block_int.h |  5 +++++
>>  3 files changed, 52 insertions(+)
>>
> 
>> + * Hot add/remove a BDS's child. So the user can take a child offline when
>> + * it is broken and take a new child online
>> + */
>> +void bdrv_add_child(BlockDriverState *bs, QDict *options, Error **errp)
>> +{
>> +
>> +    if (!bs->drv || !bs->drv->bdrv_add_child) {
>> +        error_setg(errp, "The BDS %s doesn't support adding a child",
>> +                   bdrv_get_device_or_node_name(bs));
>> +        return;
>> +    }
>> +
>> +    bs->drv->bdrv_add_child(bs, options, errp);
> 
> Should this also check that bs is not already a child of something?  Or
> a bit looser, we may want to allow a BDS to be a child of multiple trees
> (a common shared backing file), but we still definitely don't want to
> allow nonsensical loops such as trying to make a BDS be hot-added as its
> own child.
> 

hot-added BDS is a new BDS, but it is OK to check it here. I will update it
in the next version.

Thanks
Wen Congyang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]