mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: migration: Don't crash on access to 'current' job
When a VM is destroyed while being migrated (waiting in
qemuMigrationSrcWaitForCompletion) the private object cleanup code frees
the 'current' job info. Since the migration code attempts to setup
various aspects of the current job even on failure this results into a
crash.
Job data is cleared in qemuDomainObjPrivateDataClear since commit
888aa4b6b9
Fix this by skipping all of the code which requires the qemu process to
be alive if the VM is not active any more.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
45f9905a3f
commit
ed1c45b0ba
@ -3561,9 +3561,9 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
||||
error:
|
||||
orig_err = virSaveLastError();
|
||||
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
if (cancel &&
|
||||
priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED &&
|
||||
virDomainObjIsActive(vm) &&
|
||||
qemuDomainObjEnterMonitorAsync(driver, vm,
|
||||
QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
|
||||
qemuMonitorMigrateCancel(priv->mon);
|
||||
@ -3576,11 +3576,12 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
|
||||
QEMU_ASYNC_JOB_MIGRATION_OUT,
|
||||
dconn);
|
||||
|
||||
if (iothread)
|
||||
qemuMigrationSrcStopTunnel(iothread, true);
|
||||
|
||||
if (priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
|
||||
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
|
||||
}
|
||||
|
||||
if (iothread)
|
||||
qemuMigrationSrcStopTunnel(iothread, true);
|
||||
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user