]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Avoid dangling migration-in job on shutoff domains
authorJiri Denemark <jdenemar@redhat.com>
Fri, 16 Mar 2012 06:56:19 +0000 (07:56 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 21 Mar 2012 16:31:09 +0000 (17:31 +0100)
commit4f061ea641ab9b993564c64fc2831687662ef8f4
tree386b967d858f25092104db820959ebedb0552474
parentbf9f0a97263f043da99f7fb95d9d6b9196b78dad
qemu: Avoid dangling migration-in job on shutoff domains

Destination daemon should not rely on the client or source daemon
(depending on the type of migration) to call Finish when migration
fails, because the client may crash before it can do so. The domain
prepared for incoming migration is set to be destroyed (and migration
job cleaned up) when connection with the client closes but this is not
enough. If the associated qemu process crashes after Prepare step and
the domain is cleaned up before the connection gets closed, autodestroy
is not called for the domain and migration jobs remains set. In case the
domain is defined on destination host (i.e., it is not completely
removed once destroyed) we keep the job set for ever. To fix this, we
register a cleanup callback which is responsible to clean migration-in
job when a domain dies anywhere between Prepare and Finish steps. Note
that we can't blindly clean any job when spotting EOF on monitor since
normally an API is running at that time.
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_migration.c