404507
From a64f825a244c77556c0ed7c5f425ba70b28cca70 Mon Sep 17 00:00:00 2001
404507
Message-Id: <a64f825a244c77556c0ed7c5f425ba70b28cca70@dist-git>
404507
From: Pavel Hrdina <phrdina@redhat.com>
404507
Date: Tue, 2 Jan 2018 12:39:13 +0100
404507
Subject: [PATCH] conf: honor maxnames in nodeListDevices API
404507
404507
Introduced by commit <4ae9dbea99c>.
404507
404507
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572
404507
404507
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
404507
(cherry picked from commit bbf6573e94528ac8a8867855e6671b48e13f1cd1)
404507
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
404507
Reviewed-by: Erik Skultety <eskultet@redhat.com>
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/conf/virnodedeviceobj.c | 3 +++
404507
 1 file changed, 3 insertions(+)
404507
404507
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
404507
index 872ec1fd4b..c4e3a40d3a 100644
404507
--- a/src/conf/virnodedeviceobj.c
404507
+++ b/src/conf/virnodedeviceobj.c
404507
@@ -798,6 +798,9 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
404507
     if (data->error)
404507
         return 0;
404507
 
404507
+    if (data->nnames >= data->maxnames)
404507
+        return 0;
404507
+
404507
     virObjectLock(obj);
404507
     def = obj->def;
404507
 
404507
-- 
404507
2.15.1
404507