[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] monitor: Add netdev_del id argument completion.
From: |
Hani Benhabiles |
Subject: |
[Qemu-devel] [PATCH 7/7] monitor: Add netdev_del id argument completion. |
Date: |
Sun, 9 Mar 2014 12:16:17 +0100 |
Signed-off-by: Hani Benhabiles <address@hidden>
---
hmp-commands.hx | 1 +
hmp.h | 1 +
monitor.c | 15 +++++++++++++++
3 files changed, 17 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index b009561..d252ffc 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1244,6 +1244,7 @@ ETEXI
.params = "id",
.help = "remove host network device",
.mhandler.cmd = hmp_netdev_del,
+ .command_completion = netdev_del_completion,
},
STEXI
diff --git a/hmp.h b/hmp.h
index cda0943..ef0fcd3 100644
--- a/hmp.h
+++ b/hmp.h
@@ -101,6 +101,7 @@ void chardev_remove_completion(Monitor *mon, int nb_args,
const char *str);
void cpu_completion(Monitor *mon, int nb_args, const char *str);
void set_link_completion(Monitor *mon, int nb_args, const char *str);
void netdev_add_completion(Monitor *mon, int nb_args, const char *str);
+void netdev_del_completion(Monitor *mon, int nb_args, const char *str);
#endif
diff --git a/monitor.c b/monitor.c
index b1378c6..3d194fa 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4516,6 +4516,21 @@ void set_link_completion(Monitor *mon, int nb_args,
const char *str)
}
}
+void netdev_del_completion(Monitor *mon, int nb_args, const char *str)
+{
+ struct NicCompletionData data = {
+ .mon = mon,
+ .str = str,
+ };
+
+ if (nb_args != 2) {
+ return;
+ }
+
+ readline_set_completion_index(mon->rs, strlen(str));
+ qemu_foreach_nic(check_nic_completion, &data);
+}
+
static void monitor_find_completion_by_table(Monitor *mon,
const mon_cmd_t *cmd_table,
char **args,
--
1.8.3.2
- [Qemu-devel] [PATCH 2/7] monitor: Add chardev-remove id argument completion., (continued)
- [Qemu-devel] [PATCH 2/7] monitor: Add chardev-remove id argument completion., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 1/7] monitor: Add command_completion callback to mon_cmd_t., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 3/7] monitor: Add chardev-add backend argument completion., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 4/7] monitor: Add cpu index argument completion., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 5/7] monitor: Add set_link arguments completion., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 6/7] monitor: Add netdev_add type argument completion., Hani Benhabiles, 2014/03/09
- [Qemu-devel] [PATCH 7/7] monitor: Add netdev_del id argument completion.,
Hani Benhabiles <=
- Re: [Qemu-devel] [PATCH 0/7] monitor: Completion support for various commands., Luiz Capitulino, 2014/03/10
- Re: [Qemu-devel] [PATCH 0/7] monitor: Completion support for various commands., Luiz Capitulino, 2014/03/27