From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bjL-000256-RX for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:48:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bjK-0007Ay-Tv for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:48:39 -0500 Date: Thu, 17 Dec 2015 16:48:28 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20151217164827.GE2484@work-vm> References: <1450349251-10326-1-git-send-email-dgilbert@redhat.com> <5672E63C.80303@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672E63C.80303@redhat.com> 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: Eric Blake Cc: qemu-block@nongnu.org, zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org * Eric Blake (eblake@redhat.com) wrote: > On 12/17/2015 03:47 AM, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > x-blockdev-change has no HMP equivalent, so add x_block_change. > > > > Example useages are: > > s/useages/usages/ Yep. > > x_block_change foo -a bah > > to add the node bah to the parent foo > > > > x_block_change foo -d bah > > to delete the node bah from the parent foo > > > > Signed-off-by: Dr. David Alan Gilbert > > --- > > > +void hmp_block_change(Monitor *mon, const QDict *qdict) > > +{ > > + const char *parent = qdict_get_str(qdict, "parent"); > > + const char *child = qdict_get_str(qdict, "child"); > > + bool add = qdict_get_try_bool(qdict, "add", false); > > + bool del = qdict_get_try_bool(qdict, "del", false); > > + Error *err = NULL; > > + > > + if (add == del) { > > + error_setg(&err, "One of -a or -d must be set"); > > Maybe s/One/Exactly one/ ? Yep, can do. > 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. Oh I was assuming if we wanted to make a 'change' we'd add a -c. > So I'm fine with fixing the minor issues mentioned above, and adding: > > Reviewed-by: Eric Blake Thanks. Dave > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK