From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoMIh-0002Da-QH for qemu-devel@nongnu.org; Wed, 04 Dec 2013 18:56:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoMIc-0000T2-Py for qemu-devel@nongnu.org; Wed, 04 Dec 2013 18:56:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoMIc-0000Se-HK for qemu-devel@nongnu.org; Wed, 04 Dec 2013 18:56:10 -0500 Message-ID: <529FC115.5050501@redhat.com> Date: Wed, 04 Dec 2013 16:56:05 -0700 From: Eric Blake MIME-Version: 1.0 References: <1386077165-19577-1-git-send-email-benoit@irqsave.net> <1386077165-19577-5-git-send-email-benoit@irqsave.net> In-Reply-To: <1386077165-19577-5-git-send-email-benoit@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p5t3cBIVXo2KiO4sx51LESgw2bomtnRSV" Subject: Re: [Qemu-devel] [RFC V3 4/7] qmp: Allow block_passwd to manipulate bs graph nodes. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, famz@redhat.com, armbru@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --p5t3cBIVXo2KiO4sx51LESgw2bomtnRSV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/03/2013 06:26 AM, Beno=C3=AEt Canet wrote: > Signed-off-by: Benoit Canet > --- > =20 > +BlockDriverState * bdrv_lookup_bs(bool has_device, const char * device= , > + bool has_node_name, const char * nod= e_name, Style: no space after * (3 instances) > + Error **errp) > +{ > + BlockDriverState *bs =3D NULL; > + > + if ((has_device && has_node_name) || > + (!has_device && !has_node_name)) { Could be shortened to: if (has_device =3D=3D has_node_name) { > + error_setg(errp, "Use either device or node-name but not both.= "); We tend to avoid trailing '.' on error messages > =20 > -void qmp_block_passwd(const char *device, const char *password, Error = **errp) > +void qmp_block_passwd(bool has_device, const char * device, > + bool has_node_name, const char * node_name, > + const char * password, Error **errp) Again, no space after '*' > +++ b/include/block/block.h > @@ -371,6 +371,9 @@ void bdrv_eject(BlockDriverState *bs, bool eject_fl= ag); > const char *bdrv_get_format_name(BlockDriverState *bs); > BlockDriverState *bdrv_find(const char *name); > BlockDriverState *bdrv_find_node(const char *node_name); > +BlockDriverState * bdrv_lookup_bs(bool has_device, const char * device= , > + bool has_node_name, const char * nod= e_name, > + Error **errp); And again > +++ b/qapi-schema.json > @@ -1675,7 +1675,11 @@ > # determine which ones are encrypted, set the passwords with this comm= and, and > # then start the guest with the @cont command. > # > -# @device: the name of the device to set the password on > +# Either @device or @node-name must be set but not both. > +# > +# @device: #optional the name of the block backend device to set the p= assword on > +# > +# @node-name: #optional graph node name to set the password on (Since = 1.8) 2.0 > # > # @password: the password to use for the device > # > @@ -1689,7 +1693,8 @@ > # > # Since: 0.14.0 > ## > -{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'st= r'} } > +{ 'command': 'block_passwd', 'data': {'*device': 'str', > + '*node-name': 'str', 'password':= 'str'} } Seems like a reasonable addition; shouldn't cause any back-compat problems (older management tools will always provide the now-optional 'device'). Is it intentional that you are not exposing this new functionality in HMP= ? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --p5t3cBIVXo2KiO4sx51LESgw2bomtnRSV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSn8EVAAoJEKeha0olJ0NqNmgIAKgvLEwwtdIO51XIwn91/vzk fUZTeF1q/UbWVeBhCaXGbTOrgCtXOU/Ze7z6DuLcER3r/cdBaVWx5NvaBClZkZRe SzygP4JdtrjEIdnLyFJFMJUYrPzdTTPYKRabPL1W1u9+6r0Q5O2eza3NG0kArCue IH/Gs7gTEQZlH/HMEuA+4PGwmzVyyTHV+ElpbFpLHOfI5hPpvmsyvITZXVuLys9i YgAtZmD2j2zCDaffog7wyVFoMwccnt7g5hHv7SA+ZNEMJJX2FYqFG/YPlRGMjCOQ 8ovRB52VxciGdpTe4dtRKjww/nT2Sb8rt/LBJ64yrLJucsuZGOb1Mm7PWMDNVUE= =eygd -----END PGP SIGNATURE----- --p5t3cBIVXo2KiO4sx51LESgw2bomtnRSV--