qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
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
Subject: Re: [Qemu-devel] [PATCH v1 3/3] monitor: add del completion for peripheral device
Date: Fri, 26 Sep 2014 13:25:45 -0400	[thread overview]
Message-ID: <20140926132545.183d8b89@redhat.com> (raw)
In-Reply-To: <455e2daf231fd33c3e828936c7e1e07d27c17dac.1411019133.git.zhugh.fnst@cn.fujitsu.com>

On Thu, 18 Sep 2014 15:53:21 +0800
Zhu Guihua <zhugh.fnst@cn.fujitsu.com> wrote:

> Add peripheral_device_del_completion() to let peripheral device del completion
> be possible.
> 
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> ---
>  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)

  parent reply	other threads:[~2014-09-26 17:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  7:53 [Qemu-devel] [PATCH v1 0/3] monitor: add peripheral device del completion support Zhu Guihua
2014-09-18  7:53 ` [Qemu-devel] [PATCH v1 1/3] qom: add function to get opaque property in ObjectProperty Zhu Guihua
2014-09-18  7:53 ` [Qemu-devel] [PATCH v1 2/3] qom: export object_property_is_child() Zhu Guihua
2014-09-26  9:31   ` Andreas Färber
2014-09-18  7:53 ` [Qemu-devel] [PATCH v1 3/3] monitor: add del completion for peripheral device Zhu Guihua
2014-09-26  9:29   ` Andreas Färber
2014-09-26 17:25   ` Luiz Capitulino [this message]
2014-09-26 17:29     ` Luiz Capitulino
2014-09-29 21:33       ` Hani Benhabiles
2014-09-26  2:01 ` [Qemu-devel] [PATCH v1 0/3] monitor: add peripheral device del completion support Zhu Guihua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140926132545.183d8b89@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=kroosec@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=zhugh.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).