From: Luiz Capitulino <lcapitulino@redhat.com>
To: Hani Benhabiles <kroosec@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] monitor: Add device_del argument completion.
Date: Mon, 10 Feb 2014 15:16:56 -0500 [thread overview]
Message-ID: <20140210151656.74c32599@redhat.com> (raw)
In-Reply-To: <1390859654-8549-1-git-send-email-kroosec@gmail.com>
On Mon, 27 Jan 2014 22:54:14 +0100
Hani Benhabiles <kroosec@gmail.com> wrote:
> Signed-off-by: Hani Benhabiles <kroosec@gmail.com>
Applied to the qmp branch, thanks.
> ---
> monitor.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/monitor.c b/monitor.c
> index 80456fb..a7a589e 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -4254,6 +4254,25 @@ static const char *next_arg_type(const char *typestr)
> return (p != NULL ? ++p : typestr);
> }
>
> +static void device_del_completion(ReadLineState *rs, BusState *bus,
> + const char *str, size_t len)
> +{
> + BusChild *kid;
> +
> + QTAILQ_FOREACH(kid, &bus->children, sibling) {
> + DeviceState *dev = kid->child;
> + BusState *dev_child;
> +
> + if (dev->id && !strncmp(str, dev->id, len)) {
> + readline_add_completion(rs, dev->id);
> + }
> +
> + QLIST_FOREACH(dev_child, &dev->child_bus, sibling) {
> + device_del_completion(rs, dev_child, str, len);
> + }
> + }
> +}
> +
> static void monitor_find_completion_by_table(Monitor *mon,
> const mon_cmd_t *cmd_table,
> char **args,
> @@ -4330,6 +4349,10 @@ static void monitor_find_completion_by_table(Monitor *mon,
> } else if (!strcmp(cmd->name, "help|?")) {
> monitor_find_completion_by_table(mon, cmd_table,
> &args[1], nb_args - 1);
> + } else if (!strcmp(cmd->name, "device_del") && nb_args == 2) {
> + size_t len = strlen(str);
> + readline_set_completion_index(mon->rs, len);
> + device_del_completion(mon->rs, sysbus_get_default(), str, len);
> }
> break;
> default:
prev parent reply other threads:[~2014-02-10 20:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 21:54 [Qemu-devel] [PATCH] monitor: Add device_del argument completion Hani Benhabiles
2014-02-10 20:16 ` Luiz Capitulino [this message]
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=20140210151656.74c32599@redhat.com \
--to=lcapitulino@redhat.com \
--cc=kroosec@gmail.com \
--cc=qemu-devel@nongnu.org \
/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).