From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVRJ8-0004JC-Vn for qemu-devel@nongnu.org; Fri, 18 May 2012 13:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVRJ7-0005A7-1W for qemu-devel@nongnu.org; Fri, 18 May 2012 13:49:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVRJ6-00059f-Pm for qemu-devel@nongnu.org; Fri, 18 May 2012 13:49:40 -0400 Date: Fri, 18 May 2012 14:49:53 -0300 From: Luiz Capitulino Message-ID: <20120518144953.2c9f7605@doriath.home> In-Reply-To: <4FB675A6.5010308@redhat.com> References: <1337265221-7136-1-git-send-email-lcapitulino@redhat.com> <1337265221-7136-17-git-send-email-lcapitulino@redhat.com> <4FB675A6.5010308@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 16/16] qapi: convert netdev_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com, mdroth@linux.vnet.ibm.com On Fri, 18 May 2012 18:15:34 +0200 Laszlo Ersek wrote: > On 05/17/12 16:33, Luiz Capitulino wrote: > > > diff --git a/hmp.c b/hmp.c > > index 7a4e25f..2ce8cb9 100644 > > --- a/hmp.c > > +++ b/hmp.c > > @@ -990,3 +990,12 @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict) > > out: > > hmp_handle_error(mon, &err); > > } > > + > > +void hmp_netdev_del(Monitor *mon, const QDict *qdict) > > +{ > > + const char *id = qdict_get_str(qdict, "id"); > > + Error *err = NULL; > > + > > + qmp_netdev_del(id, &err); > > + hmp_handle_error(mon, &err); > > +} > > I'm not sure what invariants "qdict" satisfies on entry to this > function... Does it certainly contain "id", and is it a string? If not, > even qdict_get_str() (or something below it) would crash, so I'll assume > we do set "id" to non-NULL here -- hmp_device_del() does the same. qdict is a dictionary containing all options passed by the user. In this context, "id" is an required option so it must exist at this point (if the user doesn't pass it HMP (the human monitor) will fail before getting here). > I'm ready to ACK the series, but I'm intrigued by the net_init_netdev() > change in 15/16... :) Thanks a lot for the review!