From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYiZr-00019A-HI for qemu-devel@nongnu.org; Mon, 29 Sep 2014 17:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYiZm-0005xy-Cg for qemu-devel@nongnu.org; Mon, 29 Sep 2014 17:33:51 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:54082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYiZm-0005xb-6x for qemu-devel@nongnu.org; Mon, 29 Sep 2014 17:33:46 -0400 Received: by mail-wi0-f171.google.com with SMTP id ho1so4286003wib.16 for ; Mon, 29 Sep 2014 14:33:39 -0700 (PDT) Date: Mon, 29 Sep 2014 22:33:33 +0100 From: Hani Benhabiles Message-ID: <20140929213333.GA6902@Inspiron-3521> References: <455e2daf231fd33c3e828936c7e1e07d27c17dac.1411019133.git.zhugh.fnst@cn.fujitsu.com> <20140926132545.183d8b89@redhat.com> <20140926132941.2af17a9f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140926132941.2af17a9f@redhat.com> Subject: Re: [Qemu-devel] [PATCH v1 3/3] monitor: add del completion for peripheral device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Zhu Guihua , hutao@cn.fujitsu.com, qemu-devel@nongnu.org, tangchen@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, aliguori@amazon.com, afaerber@suse.de On Fri, Sep 26, 2014 at 01:29:41PM -0400, Luiz Capitulino wrote: > On Fri, 26 Sep 2014 13:25:45 -0400 > Luiz Capitulino wrote: > > > On Thu, 18 Sep 2014 15:53:21 +0800 > > Zhu Guihua wrote: > > > > > Add peripheral_device_del_completion() to let peripheral device del completion > > > be possible. > > > > > > Signed-off-by: Zhu Guihua > > > --- > > > monitor.c | 24 ++++++++++++++++++++++++ > > > 1 file changed, 24 insertions(+) > > > > > > diff --git a/monitor.c b/monitor.c > > > index 667efb7..c0e00e4 100644 > > > --- a/monitor.c > > > +++ b/monitor.c > > > @@ -4351,6 +4351,29 @@ static void device_del_bus_completion(ReadLineState *rs, BusState *bus, > > > } > > > } > > > > > > +static void peripheral_device_del_completion(ReadLineState *rs, > > > + const char *str, size_t len) > > > +{ > > > + Object *peripheral; > > > + DeviceState *dev = NULL; > > > + ObjectProperty *prop; > > > + > > > + peripheral = object_resolve_path("/machine/peripheral/", NULL); > > > + > > > + if (peripheral == NULL) { > > > + return; > > > + } > > > + > > > + QTAILQ_FOREACH(prop, &peripheral->properties, node) { > > > + if (object_property_is_child(prop)) { > > > + dev = DEVICE(object_property_get_opaque(prop, NULL)); > > > + if (dev->id && !strncmp(str, dev->id, len)) { > > > + readline_add_completion(rs, dev->id); > > > + } > > > + } > > > + } > > > +} > > > + > > > void chardev_remove_completion(ReadLineState *rs, int nb_args, const char *str) > > > { > > > size_t len; > > > @@ -4424,6 +4447,7 @@ void device_del_completion(ReadLineState *rs, int nb_args, const char *str) > > > len = strlen(str); > > > readline_set_completion_index(rs, len); > > > device_del_bus_completion(rs, sysbus_get_default(), str, len); > > > + peripheral_device_del_completion(rs, str, len); > > > } > > > > The series intro email mentions device_del, but this is added to > > chardev-remove. Is there a reason for this? > > Turns out this is not added to chardev_remove_completion(), looked too > quickly. In any case, would be nice to have Hani's review. Hi, I'm wrestling with my ISP at the moment. Will get back to these as soon as possible Thanks. > > > > > Hani, could you please review this series? > > > > > > > > void object_del_completion(ReadLineState *rs, int nb_args, const char *str) > > >