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

Pavel Hrdina posted 1 patch 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/bbf6573e94528ac8a8867855e6671b48e13f1cd1.1514885308.git.phrdina@redhat.com
src/conf/virnodedeviceobj.c | 3 +++
1 file changed, 3 insertions(+)
[libvirt] [PATCH] conf: honor maxnames in nodeListDevices API
Posted by Pavel Hrdina 6 years, 3 months ago
Introduced by commit <4ae9dbea99c>.

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

Signed-off-by: Pavel Hrdina <phrdina@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] conf: honor maxnames in nodeListDevices API
Posted by Michal Privoznik 6 years, 3 months ago
On 01/02/2018 10:28 AM, Pavel Hrdina wrote:
> Introduced by commit <4ae9dbea99c>.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572
> 
> Signed-off-by: Pavel Hrdina <phrdina@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;
>  
> 

ACK

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list