From: Hani Benhabiles <kroosec@gmail.com>
To: qemu-devel@nongnu.org
Cc: imammedo@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 3/4] monitor: Add object_del id argument completion.
Date: Thu, 6 Feb 2014 23:30:12 +0100 [thread overview]
Message-ID: <1391725813-29514-4-git-send-email-kroosec@gmail.com> (raw)
In-Reply-To: <1391725813-29514-1-git-send-email-kroosec@gmail.com>
---
monitor.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/monitor.c b/monitor.c
index 65410cb..4a2c1ae 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4294,6 +4294,27 @@ static void device_del_completion(ReadLineState *rs, BusState *bus,
}
}
+static void object_del_completion(ReadLineState *rs, const char *str)
+{
+ ObjectPropertyInfoList *list, *start;
+ size_t len;
+
+ len = strlen(str);
+ readline_set_completion_index(rs, len);
+
+ start = list = qmp_qom_list("/objects", NULL);
+ while (list) {
+ ObjectPropertyInfo *info = list->value;
+
+ if (!strncmp(info->type, "child<", 5)
+ && !strncmp(info->name, str, len)) {
+ readline_add_completion(rs, info->name);
+ }
+ list = list->next;
+ }
+ qapi_free_ObjectPropertyInfoList(start);
+}
+
static void monitor_find_completion_by_table(Monitor *mon,
const mon_cmd_t *cmd_table,
char **args,
@@ -4379,6 +4400,8 @@ static void monitor_find_completion_by_table(Monitor *mon,
size_t len = strlen(str);
readline_set_completion_index(mon->rs, len);
device_del_completion(mon->rs, sysbus_get_default(), str, len);
+ } else if (!strcmp(cmd->name, "object_del") && nb_args == 2) {
+ object_del_completion(mon->rs, str);
}
break;
default:
--
1.8.3.2
next prev parent reply other threads:[~2014-02-06 22:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 22:30 [Qemu-devel] [PATCH 0/4] monitor: Add argument completion for multiple commands Hani Benhabiles
2014-02-06 22:30 ` [Qemu-devel] [PATCH 1/4] monitor: Add device_del id argument completion Hani Benhabiles
2014-02-11 18:35 ` Luiz Capitulino
2014-02-06 22:30 ` [Qemu-devel] [PATCH 2/4] monitor: Add device_add device " Hani Benhabiles
2014-02-06 22:30 ` Hani Benhabiles [this message]
2014-02-06 22:30 ` [Qemu-devel] [PATCH 4/4] monitor: Add object_add class " Hani Benhabiles
2014-02-11 18:38 ` Luiz Capitulino
2014-02-11 22:14 ` Hani Benhabiles
2014-02-11 18:39 ` [Qemu-devel] [PATCH 0/4] monitor: Add argument completion for multiple commands Luiz Capitulino
2014-02-11 22:10 ` Hani Benhabiles
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=1391725813-29514-4-git-send-email-kroosec@gmail.com \
--to=kroosec@gmail.com \
--cc=imammedo@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.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).