[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/22] monitor: Add device_add device argument comple
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 20/22] monitor: Add device_add device argument completion. |
Date: |
Thu, 13 Feb 2014 10:30:38 -0500 |
From: Hani Benhabiles <address@hidden>
Signed-off-by: Hani Benhabiles <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/monitor.c b/monitor.c
index c90fc1d..4ffe44d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4254,6 +4254,27 @@ static const char *next_arg_type(const char *typestr)
return (p != NULL ? ++p : typestr);
}
+static void device_add_completion(ReadLineState *rs, const char *str)
+{
+ GSList *list, *elt;
+ size_t len;
+
+ len = strlen(str);
+ readline_set_completion_index(rs, len);
+ list = elt = object_class_get_list(TYPE_DEVICE, false);
+ while (elt) {
+ const char *name;
+ DeviceClass *dc = OBJECT_CLASS_CHECK(DeviceClass, elt->data,
+ TYPE_DEVICE);
+ name = object_class_get_name(OBJECT_CLASS(dc));
+ if (!strncmp(name, str, len)) {
+ readline_add_completion(rs, name);
+ }
+ elt = elt->next;
+ }
+ g_slist_free(list);
+}
+
static void device_del_completion(ReadLineState *rs, BusState *bus,
const char *str, size_t len)
{
@@ -4336,6 +4357,11 @@ static void monitor_find_completion_by_table(Monitor
*mon,
readline_set_completion_index(mon->rs, strlen(str));
bdrv_iterate(block_completion_it, &mbs);
break;
+ case 'O':
+ if (!strcmp(cmd->name, "device_add") && nb_args == 2) {
+ device_add_completion(mon->rs, str);
+ }
+ break;
case 's':
case 'S':
if (!strcmp(cmd->name, "sendkey")) {
--
1.8.1.4
- [Qemu-devel] [PULL 08/22] dump: add API to write vmcore, (continued)
- [Qemu-devel] [PULL 08/22] dump: add API to write vmcore, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 10/22] dump: add support for lzo/snappy, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 11/22] dump: add members to DumpState and init some of them, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 12/22] dump: add API to write dump header, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 13/22] dump: add API to write dump_bitmap, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 14/22] dump: add APIs to operate DataCache, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 15/22] dump: add API to write dump pages, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 18/22] dump: add 'query-dump-guest-memory-capability' command, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 16/22] dump: make kdump-compressed format available for 'dump-guest-memory', Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 19/22] monitor: Add device_del id argument completion., Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 20/22] monitor: Add device_add device argument completion.,
Luiz Capitulino <=
- [Qemu-devel] [PULL 22/22] monitor: Add object_add class argument completion., Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 21/22] monitor: Add object_del id argument completion., Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 17/22] dump: Define the architecture for compressed dump format., Luiz Capitulino, 2014/02/13
- Re: [Qemu-devel] [PULL 00/22] QMP queue, Peter Maydell, 2014/02/15