render / rpms / libvirt

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