Blob Blame Raw
From 9c2a6798c053cec989e02935e810a0d239fb493c Mon Sep 17 00:00:00 2001
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Wed, 16 Dec 2015 02:59:35 +0100
Subject: [PATCH 1/2] net: Make qmp_query_rx_filter() with name argument more
 obvious

RH-Author: Vlad Yasevich <vyasevic@redhat.com>
Message-id: <1450234776-7779-2-git-send-email-vyasevic@redhat.com>
Patchwork-id: 68620
O-Subject: [RHEL7.3 qemu-kvm PATCH 1/2] net: Make qmp_query_rx_filter() with name argument more obvious
Bugzilla: 1269738
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>

From: Markus Armbruster <armbru@redhat.com>

With a client name, the QMP command is specified to return a list of
one element.  This isn't locally obvious in the code.  Make it so.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 638fb14169ad96cf9bc0dd5f61460daaecee5bb1)
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 net/net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/net.c b/net/net.c
index a8c49fc..0be50a0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1000,6 +1000,10 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
                        " rx-filter querying", name);
             break;
         }
+
+        if (has_name) {
+            break;
+        }
     }
 
     if (filter_list == NULL && !error_is_set(errp) && has_name) {
-- 
1.8.3.1