]> xenbits.xensource.com Git - libvirt.git/commit
tests: Move domainEventState initialization to qemuTestDriverInit
authorRayhan Faizel <rayhan.faizel@gmail.com>
Wed, 3 Jul 2024 21:40:13 +0000 (03:10 +0530)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Jul 2024 07:27:34 +0000 (09:27 +0200)
commitd666426718604b54b2c06458a621e7a70a263434
treeb84c867ba125bec60f7e217a4f3af64b5843e840
parentf67b12ba35e7a59c64163c41943ab37a00f052f0
tests: Move domainEventState initialization to qemuTestDriverInit

Under the test environment, driver->domainEventState is uninitialized. If a
disk gets dropped, it will attempt to queue an event which will cause a
segmentation fault. This crash does not occur during normal use.

This patch moves driver->domainEventState initialization from qemuhotplugtest
to qemuTestDriverInit in testutilsqemu (Credit goes to Michal Privoznik as he
had already provided the diff).

An additional test case is added to test dropping of disks with startupPolicy
set as optional.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemuhotplugtest.c
tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.x86_64-latest.args [new file with mode: 0644]
tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.xml [new file with mode: 0644]
tests/qemuxmlconftest.c
tests/testutilsqemu.c