From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bem-0003pi-2F for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:43:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bei-0005qK-0K for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:43:55 -0500 References: <1450349251-10326-1-git-send-email-dgilbert@redhat.com> From: Eric Blake Message-ID: <5672E63C.80303@redhat.com> Date: Thu, 17 Dec 2015 09:43:40 -0700 MIME-Version: 1.0 In-Reply-To: <1450349251-10326-1-git-send-email-dgilbert@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9Ck4F1NmEeK0WX9KdwDXI6bwlwTrAjo4O" Subject: Re: [Qemu-devel] [PATCH 1/1] HMP: Add equivalent to x-blockdev-change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , wency@cn.fujitsu.com, zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9Ck4F1NmEeK0WX9KdwDXI6bwlwTrAjo4O Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/17/2015 03:47 AM, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" >=20 > x-blockdev-change has no HMP equivalent, so add x_block_change. >=20 > Example useages are: s/useages/usages/ > x_block_change foo -a bah > to add the node bah to the parent foo >=20 > x_block_change foo -d bah > to delete the node bah from the parent foo >=20 > Signed-off-by: Dr. David Alan Gilbert > --- > +void hmp_block_change(Monitor *mon, const QDict *qdict) > +{ > + const char *parent =3D qdict_get_str(qdict, "parent"); > + const char *child =3D qdict_get_str(qdict, "child"); > + bool add =3D qdict_get_try_bool(qdict, "add", false); > + bool del =3D qdict_get_try_bool(qdict, "del", false); > + Error *err =3D NULL; > + > + if (add =3D=3D del) { > + error_setg(&err, "One of -a or -d must be set"); Maybe s/One/Exactly one/ ? Limited in that we may eventually want to allow both add and delete at the same time; but HMP does not have hard-and-fast back-compat rules. So I'm fine with fixing the minor issues mentioned above, and adding: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9Ck4F1NmEeK0WX9KdwDXI6bwlwTrAjo4O 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/ iQEcBAEBCAAGBQJWcuY8AAoJEKeha0olJ0NqnUoH+wcwhlIH98VJbheqb6Qe7sbS X9vZK4+F1ndmekWPOKw8wd+o76pgqKBNzeqrXtESpQ+G7HD6Mb3kERbWOd8kRvS0 hK0AUIDaEy00iGxbpOxdyM+nEsHB1ATqM9/faF5rZsM99ATpoDNrIm1ZQQ8QNEgG CKF8qg02j10iD1lWBN4rjsCsm8SDwuykxBPKBPlucNUI/nfsVtdgcw8hXc8dJtnN WZULJvYiL9PW6iiW6R29Vwdar1QJvlBN2TbjVTJqU6jdUGn8ZYAroSZwxFtmsjtE 4meP55VXvV1eatgQ/Cr6MUGslwxLxtyIdRFRvaAgM9gnMWGxJejIE736RnrdwNk= =jfgR -----END PGP SIGNATURE----- --9Ck4F1NmEeK0WX9KdwDXI6bwlwTrAjo4O--