qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: aliguori@amazon.com, stefanha@redhat.com, qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: [Qemu-devel] [PATCH 4/4] monitor: more accurate completion for host_net_remove()
Date: Mon,  2 Feb 2015 15:06:38 +0800	[thread overview]
Message-ID: <1422860798-17495-4-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1422860798-17495-1-git-send-email-jasowang@redhat.com>

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>
---
 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);
-- 
1.9.1

  parent reply	other threads:[~2015-02-02  7:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  7:06 [Qemu-devel] [PATCH 1/4] monitor: print hub port name during info network Jason Wang
2015-02-02  7:06 ` [Qemu-devel] [PATCH 2/4] net: remove the wrong comment in net_init_hubport() Jason Wang
2015-02-02  7:06 ` [Qemu-devel] [PATCH 3/4] net: del hub port when peer is deleted Jason Wang
2015-02-05 14:25   ` Stefan Hajnoczi
2015-02-06  9:29     ` Jason Wang
2015-02-06 14:06       ` Stefan Hajnoczi
2015-02-02  7:06 ` Jason Wang [this message]
2015-02-06 14:06 ` [Qemu-devel] [PATCH 1/4] monitor: print hub port name during info network Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422860798-17495-4-git-send-email-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).