]> xenbits.xensource.com Git - libvirt.git/commit
qemuDomainObjWait: Report error when VM is being destroyed
authorPeter Krempa <pkrempa@redhat.com>
Wed, 10 Aug 2022 13:39:57 +0000 (15:39 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Aug 2022 12:34:25 +0000 (14:34 +0200)
commit4d1a1fdffda19a62d62fa2457d16236247781a74
tree3380b812b790c1b7803d6b6a1a783f0f6b02b52c
parent24fb0270c6eb435b28e2b11df9df31db847a8cf4
qemuDomainObjWait: Report error when VM is being destroyed

Since we started handling the monitor EOF event inside a job any code
which uses virDomainObjWait would no longer properly abort in case when
the VM crashed during the wait.

This is because virDomainObjWait uses virDomainObjIsActive which checks
'vm->def->id' to see if the VM is still active. Unfortunately the domain
id is cleared in qemuProcessStop which is run only inside the job.

To fix this we can use the 'beingDestroyed' flag stored in the VM
private data which is set to true around the time when the condition is
signalled.

Reported-by: Pavel Hrdina <phrdina@redhat.com>
Fixes: 8c9ff9960b29d4703a99efdd1cadcf6f48799cc0
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_migration.c