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:
parent
63f22dc80f
commit
15a173fc13
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user