[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: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [Patch for-2.5 v2 3/6] Add new block driver interface to add/delete a BDS's child |
Date: |
Mon, 31 Aug 2015 11:40:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [Patch for-2.5 v2 0/6] qapi: child add/delete support, Wen Congyang, 2015/08/11
- [Qemu-devel] [Patch for-2.5 v2 1/6] QAPI: move InetSocketAddress to qapi/common.json, Wen Congyang, 2015/08/11
- [Qemu-devel] [Patch for-2.5 v2 3/6] Add new block driver interface to add/delete a BDS's child, Wen Congyang, 2015/08/11
- Re: [Qemu-devel] [Patch for-2.5 v2 3/6] Add new block driver interface to add/delete a BDS's child,
Eric Blake <=
- [Qemu-devel] [Patch for-2.5 v2 2/6] support nbd driver in blockdev-add, Wen Congyang, 2015/08/11
- [Qemu-devel] [Patch for-2.5 v2 6/6] hmp: add monitor command to add/remove a child, Wen Congyang, 2015/08/11
- [Qemu-devel] [Patch for-2.5 v2 5/6] qmp: add monitor command to add/remove a child, Wen Congyang, 2015/08/11