From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2NM7-0002Cx-BR for qemu-devel@nongnu.org; Fri, 27 Nov 2015 13:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2NM4-00036r-5V for qemu-devel@nongnu.org; Fri, 27 Nov 2015 13:02:47 -0500 Received: from resqmta-ch2-12v.sys.comcast.net ([69.252.207.44]:53209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2NM3-00036k-Vu for qemu-devel@nongnu.org; Fri, 27 Nov 2015 13:02:44 -0500 References: <1448636346-24641-1-git-send-email-hare@suse.de> <1448636346-24641-9-git-send-email-hare@suse.de> From: Eric Blake Message-ID: <56589A35.7080800@redhat.com> Date: Fri, 27 Nov 2015 11:00:21 -0700 MIME-Version: 1.0 In-Reply-To: <1448636346-24641-9-git-send-email-hare@suse.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GL6S1hnkPoB1xMcSQpGt1KlfummabFk4J" Subject: Re: [Qemu-devel] [PATCH 8/8] block: Implement 'block_disconnect' HMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke , Paolo Bonzini Cc: Johannes Thumshirn , Stefan Hajnoczi , Hannes Reinecke , qemu-devel@nongnu.org, Alexander Graf This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GL6S1hnkPoB1xMcSQpGt1KlfummabFk4J Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/27/2015 07:59 AM, Hannes Reinecke wrote: > Implement a 'block_disconnect' HMP command to simulate a device > communication / link failure. >=20 > Signed-off-by: Hannes Reinecke > --- > +++ b/qapi/block-core.json > @@ -754,6 +754,27 @@ > 'size': 'int' }} > =20 > ## > +# @block_disconnect New QMP commands should favor '-' rather than '_'; this should be 'block-disconnect'. > +# > +# Simulate block device disconnect while a guest is running. > +# > +# Either @device or @node-name must be set but not both. > +# > +# @device: #optional the name of the device to get the image resized Bad copy-and-paste? We aren't resizing anything here. > +# > +# @node-name: #optional graph node name to get the image resized (Sinc= e 2.0) And again. And since the command is new, you don't need a '(Since 2.0)'. > +# > +# @disconnect: true for disconnecting the device > +# > +# Returns: nothing on success > +# If @device is not a valid block device, DeviceNotFound > +# > +## Missing a '# Since 2.6' line. > +{ 'command': 'block_disconnect', 'data': { '*device': 'str', > + '*node-name': 'str', > + 'disconnect': 'bool' }} Mutually-exclusive 'device' vs. 'node-name' is awkward. For new commands, it is sufficient to just use 'node' (and accept both node names for the direct node to disconnect, or a device name to detach the BDS node plugged in to that device). > +block_disconnect > +---------------- > + > +Simulate a block device disconnect while a guest is running. > + > +Arguments: > + > +- "device": the device's ID, must be unique (json-string) > +- "node-name": the node name in the block driver state graph (json-str= ing) Awkward that you aren't mentioning the mutual exclusion above; and again I think that a single parameter is better than two mutually exclusive one= s. > +- "disconnect": whether to simulate a device disconnect (json-bool) Do I again call the command with 'disconnect':false to undo the disconnect? That sounds like a double-negative. It might make more sense to have: { 'command':'block-set-connection', 'data': { 'node':'str', 'connected':'bool' } } where I pass 'connected':false to disconnect, and 'connected':true to reconnect. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --GL6S1hnkPoB1xMcSQpGt1KlfummabFk4J 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/ iQEcBAEBCAAGBQJWWJo1AAoJEKeha0olJ0Nqdm8IAJ3jgq0/pSG7cXctFNoSDD35 ChLYqUmFWIY07TDCWRVLFHEAZFTXLIppiup64VbkKGO8lmwJIO+iR6iPm3wg0JOM kLst2Jlf26hpCl2LuOoeL6DiVbhCPyqzTs2t/but8vVvUWaBY6SGyBWQl4No/vnA 7Ugw3N/+kbJm2e5MX8aQZ0RbSIMzUSzAPXGyMncUkHZBALP7oG1N6pzGyCt1r3rG OkpGn16etXit7RmlAgPmSysU93qmksTUSSUchFJHd1Dv2oYkv00fUSHrGOeb64ca NoSpCQm53lBC+5FH1XcJU1N3j/hxcRnyY8hE6Sw6xTFPyjwEAS/p4e+7P89kB0I= =8HCh -----END PGP SIGNATURE----- --GL6S1hnkPoB1xMcSQpGt1KlfummabFk4J--