]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuMigrationSrcRun: Re-check whether VM is active before accessing job data
authorPeter Krempa <pkrempa@redhat.com>
Thu, 13 Jun 2024 14:21:47 +0000 (16:21 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jun 2024 07:58:52 +0000 (09:58 +0200)
commite00a58c10aa6a8f4b6ba6f9611bee4cd66869bda
tree63af0c814336c12c36962360ed757741f005bdfb
parent9243e87820cdcc54653fa1b346ecef910ac29e12
qemuMigrationSrcRun: Re-check whether VM is active before accessing job data

'qemuProcessStop()' clears the 'current' job data. While the code under
the 'error' label in 'qemuMigrationSrcRun()' does check that the VM is
active before accessing the job, it also invokes multiple helper
functions to clean up the migration including
'qemuMigrationSrcNBDCopyCancel()' which calls 'qemuDomainObjWait()'
invalidating the result of the liveness check as it unlocks the VM.

Duplicate the liveness check and explain why. The rest of the code e.g.
accessing the monitor is safe as 'qemuDomainEnterMonitorAsync()'
performs a liveness check. The cleanup path just ignores the return
values of those functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration.c