[libvirt] [PATCH] conf: honor maxnames in nodeListDevices API

Pavel Hrdina phrdina at redhat.com
Tue Jan 2 09:28:41 UTC 2018


Introduced by commit <4ae9dbea99c>.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/conf/virnodedeviceobj.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 872ec1fd4b..c4e3a40d3a 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -798,6 +798,9 @@ virNodeDeviceObjListGetNamesCallback(void *payload,
     if (data->error)
         return 0;
 
+    if (data->nnames >= data->maxnames)
+        return 0;
+
     virObjectLock(obj);
     def = obj->def;
 
-- 
2.14.3




More information about the libvir-list mailing list