On Fri, 18 May 2012 18:15:34 +0200 Laszlo Ersek <ler...@redhat.com> 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!