Received: from eggs.gnu.org ([2001:4830:134:3::10]:59257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjotH-0002lZ-6i for qemu-devel@nongnu.org; Wed, 07 Oct 2015 09:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjotB-0003Cj-FH for qemu-devel@nongnu.org; Wed, 07 Oct 2015 09:36:19 -0400 From: Alberto Garcia In-Reply-To: <1442907862-21376-2-git-send-email-wency@cn.fujitsu.com> References: <1442907862-21376-1-git-send-email-wency@cn.fujitsu.com> <1442907862-21376-2-git-send-email-wency@cn.fujitsu.com> Date: Wed, 07 Oct 2015 15:35:32 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v5 1/4] Add new block driver interface to add/delete a BDS's child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , qemu devel , Eric Blake , Markus Armbruster , Stefan Hajnoczi Cc: Kevin Wolf , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Gonglei , Yang Hongyang , zhanghailiang On Tue 22 Sep 2015 09:44:19 AM CEST, Wen Congyang wrote: > In some cases, we want to take a quorum child offline, and take > another child online. > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Reviewed-by: Eric Blake > +void bdrv_add_child(BlockDriverState *parent_bs, BlockDriverState *child_bs, > + Error **errp) > +{ > + > + if (!parent_bs->drv || !parent_bs->drv->bdrv_add_child) { > + error_setg(errp, "The BDS %s doesn't support adding a child", > + bdrv_get_device_or_node_name(parent_bs)); > + return; > + } > + > + if (!QLIST_EMPTY(&child_bs->parents)) { > + error_setg(errp, "The BDS %s already has parent", > + child_bs->node_name); I think there's one 'a' missing: "The BDS %s already has a parent". I also don't think we should use "BDS" in error messages, that's an acronym for the name of a C data type, not something that the user is supposed to know about. I suggest using 'Node' instead. Otherwise the patch looks good to me, thanks! Berto