[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/7] monitor: Add netdev_add type argument completio
From: |
Hani Benhabiles |
Subject: |
[Qemu-devel] [PATCH 6/7] monitor: Add netdev_add type argument completion. |
Date: |
Sun, 9 Mar 2014 12:16:16 +0100 |
Also update the command's documentation.
Signed-off-by: Hani Benhabiles <address@hidden>
---
hmp-commands.hx | 3 ++-
hmp.h | 1 +
monitor.c | 18 ++++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index fbd303a..b009561 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1226,9 +1226,10 @@ ETEXI
{
.name = "netdev_add",
.args_type = "netdev:O",
- .params =
"[user|tap|socket|hubport|netmap],id=str[,prop=value][,...]",
+ .params =
"[user|tap|socket|vde|bridge|hubport|netmap],id=str[,prop=value][,...]",
.help = "add host network device",
.mhandler.cmd = hmp_netdev_add,
+ .command_completion = netdev_add_completion,
},
STEXI
diff --git a/hmp.h b/hmp.h
index df19f1c..cda0943 100644
--- a/hmp.h
+++ b/hmp.h
@@ -100,6 +100,7 @@ void chardev_add_completion(Monitor *mon, int nb_args,
const char *str);
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);
#endif
diff --git a/monitor.c b/monitor.c
index 9905113..b1378c6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4312,6 +4312,24 @@ void chardev_add_completion(Monitor *mon, int nb_args,
const char *str)
qapi_free_ChardevBackendInfoList(start);
}
+void netdev_add_completion(Monitor *mon, int nb_args, const char *str)
+{
+ size_t len;
+
+ if (nb_args != 2) {
+ return;
+ }
+ len = strlen(str);
+ readline_set_completion_index(mon->rs, len);
+ add_completion_option(mon, str, "user");
+ add_completion_option(mon, str, "tap");
+ add_completion_option(mon, str, "socket");
+ add_completion_option(mon, str, "vde");
+ add_completion_option(mon, str, "bridge");
+ add_completion_option(mon, str, "hubport");
+ add_completion_option(mon, str, "netmap");
+}
+
void device_add_completion(Monitor *mon, int nb_args, const char *str)
{
GSList *list, *elt;
--
1.8.3.2
- [Qemu-devel] [PATCH 0/7] monitor: Completion support for various commands., Hani Benhabiles, 2014/03/09
- [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 <=
- [Qemu-devel] [PATCH 7/7] monitor: Add netdev_del id argument completion., Hani Benhabiles, 2014/03/09
- 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