From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjcm-0006B8-B4 for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:11:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJjcl-0004V8-9i for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:11:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJjcl-0004Uz-1K for qemu-devel@nongnu.org; Fri, 06 Feb 2015 09:11:11 -0500 From: Stefan Hajnoczi Date: Fri, 6 Feb 2015 14:10:52 +0000 Message-Id: <1423231852-22075-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1423231852-22075-1-git-send-email-stefanha@redhat.com> References: <1423231852-22075-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 6/6] monitor: more accurate completion for host_net_remove() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Jason Wang , Stefan Hajnoczi , Luiz Capitulino From: Jason Wang Current completion for host_net_remove will show hub ports and clients that were not peered with hub ports. Fix this. Cc: Luiz Capitulino Signed-off-by: Jason Wang Message-id: 1422860798-17495-4-git-send-email-jasowang@redhat.com Signed-off-by: Stefan Hajnoczi --- monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monitor.c b/monitor.c index 7e4f605..e6dc50a 100644 --- a/monitor.c +++ b/monitor.c @@ -4597,8 +4597,13 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str) count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC, 255); for (i = 0; i < count; i++) { + int id; const char *name; + if (ncs[i]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT || + net_hub_id_for_client(ncs[i], &id)) { + continue; + } name = ncs[i]->name; if (!strncmp(str, name, len)) { readline_add_completion(rs, name); -- 2.1.0