From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuVGO-0000UL-2C for qemu-devel@nongnu.org; Thu, 05 Nov 2015 19:52:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuVGN-0007zR-8X for qemu-devel@nongnu.org; Thu, 05 Nov 2015 19:52:19 -0500 References: <1444985866-12969-1-git-send-email-wency@cn.fujitsu.com> <1444985866-12969-4-git-send-email-wency@cn.fujitsu.com> From: Wen Congyang Message-ID: <563BF970.3050607@cn.fujitsu.com> Date: Fri, 6 Nov 2015 08:50:56 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 3/4] qmp: add monitor command to add/remove a child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu devel , Eric Blake , Markus Armbruster , Kevin Wolf , Stefan Hajnoczi Cc: zhanghailiang , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Gonglei , Yang Hongyang On 11/05/2015 09:49 PM, Alberto Garcia wrote: > On Fri 16 Oct 2015 10:57:45 AM CEST, Wen Congyang wrote: > >> The new QMP command name is x-blockdev-change. It justs for >> adding/removing quorum's child now, and don't support all kinds of >> children, all kinds of operations, nor all block drivers. So it is >> experimental now. > > I might have missed some discussion, why were the -add and -delete This monitor command can be used to implement: add, delete, insert, remove, replace... Currently, I only implement add and delete operation. > >> +# @x-blockdev-change >> +# >> +# Dynamic reconfigure the block driver state graph. It can be used to >> +# add, remove, insert, replace a block driver state. Currently only >> +# the Quorum driver implements this feature to add and remove its child. >> +# This is useful to fix a broken quorum child. >> +# >> +# @operation: the chanage operation. It can be add, delete. >> +# >> +# @parent: the id or node name of which node will be changed. >> +# >> +# @child: the child node-name which will be deleted. >> +# >> +# @node: the new node-name which will be added. >> +# >> +# Note: this command is experimental, and not a stable API. >> +# >> +# Since: 2.5 >> +## >> +{ 'command': 'x-blockdev-change', >> + 'data' : { 'operation': 'ChangeOperation', >> + 'parent': 'str', >> + '*child': 'str', >> + '*node': 'str' } } > > Do you really need two separate 'child' and 'node' parameters? If the > operation is 'add' you can only use 'node', if it is 'delete, you can > only use 'child'. It seems to me that you can simply have one 'node' > parameter and use it for both ... parent and child already exist in the BDS graph, and node is a new node. In the furture, we may need to implement insert opetioan, and this operation needs such three BDSes. Thanks Wen Congyang > > Berto > . >