mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
virhostdevtest: Initialize hostdev @subsys
With recent work on storing original PCI stats in _virDomainHostdevSubsysPCI struct, the virhostdevtest can across a latent bug we had. Only some parts of the virDomainHostdevSubsys structure are initialized. Incidentally, subsys->u.pci.origstates is not one of them. This lead to unexpected crashes at runtime. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
515b24228f
commit
af954d6046
@ -123,7 +123,7 @@ myInit(void)
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < nhostdevs; i++) {
|
for (i = 0; i < nhostdevs; i++) {
|
||||||
virDomainHostdevSubsys subsys;
|
virDomainHostdevSubsys subsys = {0};
|
||||||
hostdevs[i] = virDomainHostdevDefNew();
|
hostdevs[i] = virDomainHostdevDefNew();
|
||||||
if (!hostdevs[i])
|
if (!hostdevs[i])
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user