]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuMigrationDriveMirror: Listen to events
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Feb 2015 15:25:27 +0000 (16:25 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 19 Feb 2015 13:12:38 +0000 (14:12 +0100)
commit80c5f10e865cda0302519492f197cb020bd14a07
tree705b702f831f279bf2f395b4515fc1d5fcee8c62
parent76c61cdca20c106960af033e5d0f5da70177af0f
qemuMigrationDriveMirror: Listen to events

https://bugzilla.redhat.com/show_bug.cgi?id=1179678

When migrating with storage, libvirt iterates over domain disks and
instruct qemu to migrate the ones we are interested in (shared, RO and
source-less disks are skipped). The disks are migrated in series. No
new disk is transferred until the previous one hasn't been quiesced.
This is checked on the qemu monitor via 'query-jobs' command. If the
disk has been quiesced, it practically went from copying its content
to mirroring state, where all disk writes are mirrored to the other
side of migration too. Having said that, there's one inherent error in
the design. The monitor command we use reports only active jobs. So if
the job fails for whatever reason, we will not see it anymore in the
command output. And this can happen fairly simply: just try to migrate
a domain with storage. If the storage migration fails (e.g. due to
ENOSPC on the destination) we resume the host on the destination and
let it run on partly copied disk.

The proper fix is what even the comment in the code says: listen for
qemu events instead of polling. If storage migration changes state an
event is emitted and we can act accordingly: either consider disk
copied and continue the process, or consider disk mangled and abort
the migration.

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