diff options
author | Jason Wang <jasowang@redhat.com> | 2015-02-02 15:06:38 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-02-06 14:06:45 +0000 |
commit | 2c4681f512822b4aa35371683e164d4818f21dce (patch) | |
tree | 0c4e1956830b8f63b63d08d0559055cc910f7c30 | |
parent | 64a55d60665245174acf6445e0e3f1ec7a53cfe0 (diff) | |
download | qemu-2c4681f512822b4aa35371683e164d4818f21dce.zip qemu-2c4681f512822b4aa35371683e164d4818f21dce.tar.gz qemu-2c4681f512822b4aa35371683e164d4818f21dce.tar.bz2 |
monitor: more accurate completion for host_net_remove()
Current completion for host_net_remove will show hub ports and clients
that were not peered with hub ports. Fix this.
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-id: 1422860798-17495-4-git-send-email-jasowang@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | monitor.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |