From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXZHW-0001Vs-Qc for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXZHS-0000tn-70 for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:26:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXZHR-0000tL-Ti for qemu-devel@nongnu.org; Fri, 26 Sep 2014 13:26:06 -0400 Date: Fri, 26 Sep 2014 13:25:45 -0400 From: Luiz Capitulino Message-ID: <20140926132545.183d8b89@redhat.com> In-Reply-To: <455e2daf231fd33c3e828936c7e1e07d27c17dac.1411019133.git.zhugh.fnst@cn.fujitsu.com> References: <455e2daf231fd33c3e828936c7e1e07d27c17dac.1411019133.git.zhugh.fnst@cn.fujitsu.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 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? Hani, could you please review this series? > > void object_del_completion(ReadLineState *rs, int nb_args, const char *str)