summaryrefslogtreecommitdiff
path: root/tests/virhostdevtest.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2023-02-06 15:55:31 +0100
committerMichal Privoznik <mprivozn@redhat.com>2023-02-06 16:33:26 +0100
commitaf954d60468b502ccb2ef29a1504c908d8f9d77d (patch)
tree442eab28cf84a0e782bc34a291a1d1ba656b30f5 /tests/virhostdevtest.c
parent515b24228fb2d0bb3e21b29d6e648f9d1698e943 (diff)
downloadlibvirt-af954d60468b502ccb2ef29a1504c908d8f9d77d.tar.gz
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>
Diffstat (limited to 'tests/virhostdevtest.c')
-rw-r--r--tests/virhostdevtest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index b9e16dd4e8..92bafcbb49 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -123,7 +123,7 @@ myInit(void)
size_t i;
for (i = 0; i < nhostdevs; i++) {
- virDomainHostdevSubsys subsys;
+ virDomainHostdevSubsys subsys = {0};
hostdevs[i] = virDomainHostdevDefNew();
if (!hostdevs[i])
goto cleanup;