]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Automatically kill target QEMU if migration aborts abnormally
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 23 Jun 2011 10:03:57 +0000 (11:03 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 24 Jun 2011 11:15:10 +0000 (12:15 +0100)
commit2c2effa1d7000aa97140c734a6be6e8d40df1022
treed66fcc4139040c943c81e4925600206a2d9edf49
parent558b7fd03dcc2f3a502067d1d8a142a74a9315bb
Automatically kill target QEMU if migration aborts abnormally

Migration is a multi-step process

  1. Begin(src)
  2. Prepare(dst)
  3. Perform(src)
  4. Finish(dst)
  5. Confirm(src)

At step 2, a QEMU process is lauched in the destination to
accept the incoming migration. Occasionally the process
that is controlling the migration workflow aborts, and fails
to call step 4, Finish. This leaves a QEMU process running
on the target (albeit with paused CPUs). Unfortunately because
step 2 actives a job on the QEMU process, it is unkillable by
normal means.

By registering the VM for autokill against the src virConnectPtr
in step 2, we can ensure that the guest is forcefully killed off
if the connection is closed without step 4 being invoked

* src/qemu/qemu_migration.c: Register autokill in PrepareDirect
  and PrepareTunnel. Unregister autokill on successful run
  of Finish
* src/qemu/qemu_process.c: Unregister autokill when stopping a
  process
src/qemu/qemu_migration.c