qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]