
On 7/3/24 23:40, Rayhan Faizel wrote:
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> ---
As the patch title has completely changed, v1: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/4476A...
[Changes in v2] - Move domainEventState initialization instead of adding a NULL check
tests/qemuhotplugtest.c | 3 -- ...tuppolicy-optional-drop.x86_64-latest.args | 33 ++++++++++++++++ ...rtuppolicy-optional-drop.x86_64-latest.xml | 38 +++++++++++++++++++ .../disk-startuppolicy-optional-drop.xml | 23 +++++++++++ tests/qemuxmlconftest.c | 1 + tests/testutilsqemu.c | 4 ++ 6 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/disk-startuppolicy-optional-drop.xml
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> and merged. Michal