diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2023-02-06 15:55:31 +0100 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2023-02-06 16:33:26 +0100 |
commit | af954d60468b502ccb2ef29a1504c908d8f9d77d (patch) | |
tree | 442eab28cf84a0e782bc34a291a1d1ba656b30f5 /tests/virhostdevtest.c | |
parent | 515b24228fb2d0bb3e21b29d6e648f9d1698e943 (diff) | |
download | libvirt-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.c | 2 |
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; |