From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0u0s-0000Mb-Vc for qemu-devel@nongnu.org; Mon, 23 Nov 2015 11:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0u0r-0003Ln-5r for qemu-devel@nongnu.org; Mon, 23 Nov 2015 11:30:46 -0500 References: <1448259825-3382-1-git-send-email-wency@cn.fujitsu.com> <1448259825-3382-4-git-send-email-wency@cn.fujitsu.com> From: Eric Blake Message-ID: <56533F28.7000204@redhat.com> Date: Mon, 23 Nov 2015 09:30:32 -0700 MIME-Version: 1.0 In-Reply-To: <1448259825-3382-4-git-send-email-wency@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KT7fw2fXWgbdfAoVhAPTenColREql7MPS" Subject: Re: [Qemu-devel] [Patch v7 3/3] qmp: add monitor command to add/remove a child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , qemu devel , Alberto Garcia , Kevin Wolf , Stefan Hajnoczi Cc: zhanghailiang , qemu block , Jiang Yunhong , Dong Eddie , Markus Armbruster , "Dr. David Alan Gilbert" , Gonglei This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KT7fw2fXWgbdfAoVhAPTenColREql7MPS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/22/2015 11:23 PM, Wen Congyang wrote: > The new QMP command name is x-blockdev-change. It justs for adding/remo= ving s/It justs/It's just/ > quorum's child now, and don't support all kinds of children, all kinds = of s/don't/doesn't/ > operations, nor all block drivers. So it is experimental now. >=20 > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > --- > +++ b/qapi/block-core.json > @@ -2400,3 +2400,28 @@ > ## > { 'command': 'block-set-write-threshold', > 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } } > + > +## > +# @x-blockdev-change > +# > +# Dynamically reconfigure the block driver state graph. It can be used= > +# to add, remove, insert or replace a block driver state. Currently on= ly > +# the Quorum driver implements this feature to add or remove its child= =2E > +# This is useful to fix a broken quorum child. > +# > +# @operation: the change operation. It can be add, delete. Documented but not present below. Are you missing a parameter, or should this line be deleted? > +# > +# @parent: the id or name of the node that will be changed. > +# > +# @child: #optional the name of the child that will be deleted. > +# > +# @node: #optional the name of the node will be added. > +# > +# Note: this command is experimental, and its API is not stable. > +# > +# Since: 2.6 > +## > +{ 'command': 'x-blockdev-change', > + 'data' : { 'parent': 'str', > + '*child': 'str', > + '*node': 'str' } } > +++ b/qmp-commands.hx > @@ -4285,6 +4285,53 @@ Example: > EQMP > =20 > { > + .name =3D "x-blockdev-change", > + .args_type =3D "parent:B,child:B?,node:B?", > + .mhandler.cmd_new =3D qmp_marshal_x_blockdev_change, > + }, > + > +SQMP > +x-blockdev-change > +------------ Make the --- divider as long as the text it is underlining. > + > +Dynamic reconfigure the block driver state graph. It can be used to s/Dynamic/Dynamically/ > +add, remove, insert, replace a block driver state. Currently only s/replace/or replace/ Isn't 'add' and 'insert' the same thing? > +the Quorum driver implements this feature to add and remove its child.= > +This is useful to fix a broken quorum child. > + > +Arguments: > +- "parent": the id or node name of which node will be changed > +- "child": the child name which will be delete s/delete/deleted/; mention that it is optional (if nothing is going to be delted) > +- "node": the new node-name which will be added mention that it is optional (if nothing is going to be added) > + > +Note: this command is experimental, and not a stable API. It doesn't > +support all kinds of operations, all kindes of children, nor all block= s/kindes/kinds/ > +drivers. > + > +Example: > + > +Add a new quorum's node s/quorum's node/node to a quorum/ > +-> { "execute": blockdev-add", > + "arguments": { "options": { "driver": "raw", > + "node-name": "new_node", > + "id": "test_new_node", > + "file": { "driver": "file", > + "filename": "test.raw" } } }= } > +<- { "return": {} } > +-> { "execute": "x-blockdev-change", > + "arguments": { "parent": "disk1", > + "node": "new_node" } } > +<- { "return": {} } > + > +Delete a quorum's node > +-> { "execute": "x-blockdev-change", > + "arguments": { "parent": "disk1", > + "child": "children.2" } } > +<- { "return": {} } > + > +EQMP > + > + { > .name =3D "query-named-block-nodes", > .args_type =3D "", > .mhandler.cmd_new =3D qmp_marshal_query_named_block_nodes, >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KT7fw2fXWgbdfAoVhAPTenColREql7MPS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWUz8oAAoJEKeha0olJ0NqTQAH/3B6XkPmWVsZbNd2mr/SjZyx Iafm428+6vASDEGw3LEKN+CexaqBbWdQuboEt0LkPI8qZYvjRPiVEVwa3901bYHX 57O+lQCPmEGdHn7Y+nzcPl8BmCvdYAPHnarQ6vw0Nn6G6/C7uqcjoGbNUMPE4p0s xSnugDvgjucHlNqfVPbVw/pzMOFPII8dRJqIuNHLCShZFLbgHrI4W0Yv23EvZgaD prTazKC/dPShA/NnHt3xRWExPLhzURpnXL1XEnAK53JKP9U1A3MNRJiwzwJTZ/Gd BBD/fJJr5xVH4LpKbA0kWGyhoR9A2698z+3JAr13wlSXZv7rUA94Htc+y5vlU6U= =RZmf -----END PGP SIGNATURE----- --KT7fw2fXWgbdfAoVhAPTenColREql7MPS--