From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXZLH-0003eq-Iz for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXZLC-0001lo-WB for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:30:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXZLC-0001lB-Nn for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:29:58 -0400 Date: Fri, 26 Sep 2014 13:29:41 -0400 From: Luiz Capitulino Message-ID: <20140926132941.2af17a9f@redhat.com> In-Reply-To: <20140926132545.183d8b89@redhat.com> References: <455e2daf231fd33c3e828936c7e1e07d27c17dac.1411019133.git.zhugh.fnst@cn.fujitsu.com> <20140926132545.183d8b89@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Zhu Guihua Cc: kroosec@gmail.com, 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, 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. > > Hani, could you please review this series? > > > > > void object_del_completion(ReadLineState *rs, int nb_args, const char *str) >