1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

Fix virNodeDeviceListCaps always returns empty

virNodeDeviceListCaps will always return empty for a pci nodedevice,
actually it should return 'pci'.

It is because the loop variable ncaps isn't increased.

Introduced by commit be2636f.

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

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jincheng Miao 2014-03-29 07:13:01 +08:00 committed by Ján Tomko
parent 63f22dc80f
commit 15a173fc13

View File

@ -420,7 +420,7 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
goto cleanup;
for (caps = obj->def->caps; caps && ncaps < maxnames; caps = caps->next) {
if (VIR_STRDUP(names[ncaps], virNodeDevCapTypeToString(caps->type)) < 0)
if (VIR_STRDUP(names[ncaps++], virNodeDevCapTypeToString(caps->type)) < 0)
goto cleanup;
}
ret = ncaps;