From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMbld-00034H-4k for qemu-devel@nongnu.org; Sun, 09 Mar 2014 07:19:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMblX-0000C3-9Y for qemu-devel@nongnu.org; Sun, 09 Mar 2014 07:19:41 -0400 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:56477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMblX-0000Bf-2o for qemu-devel@nongnu.org; Sun, 09 Mar 2014 07:19:35 -0400 Received: by mail-ee0-f48.google.com with SMTP id e51so2571141eek.7 for ; Sun, 09 Mar 2014 04:19:34 -0700 (PDT) From: Hani Benhabiles Date: Sun, 9 Mar 2014 12:16:17 +0100 Message-Id: <1394363777-14132-8-git-send-email-kroosec@gmail.com> In-Reply-To: <1394363777-14132-1-git-send-email-kroosec@gmail.com> References: <1394363777-14132-1-git-send-email-kroosec@gmail.com> Subject: [Qemu-devel] [PATCH 7/7] monitor: Add netdev_del id argument completion. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, imammedo@redhat.com, stefanha@redhat.com, lcapitulino@redhat.com Signed-off-by: Hani Benhabiles --- 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