Libvirt allows users to cancel ongoing migration. Internally it was implemented by sending 'migrate_cancel' command to qemu. However, from libvirt POV migration has several phases. The first is begin, where the preparation work takes place (e.g. the connection to destination is established, the domain XML is sent to destination, ABI stability is checked, etc.). The very next phase is perform, where 'migrate' command is issued and libvirt waits for qemu to migrate. However, with bad timing it was possible to issue 'migrate_cancel' prior to 'migrate' command.
This inconvenience led to situation where migration wasn't cancelled even though user requested it.
Correct fix was to check when translating to perform phase if user requested migration cancellation. That is, virDomainAbortJob() API not just issue 'migrate_cancel' but sets a flag as well. This flag is checked just before issuing 'migrate' command and may lead to not issuing the command at all (if user requested cancellation at prepare phase).
Migration can be cancelled at prepare phase as well.
This bug has been copied from bug #873792 and has been proposed
to be backported to 6.3 z-stream (EUS).
Moving to POST:
Verify pass on
# virsh migrate --live vr-rhel6u3-x86_64-kvm qemu+ssh://10.66.84.16/system --verbose & usleep 500000; virsh domjobabort vr-rhel6u3-x86_64-kvm
error: operation aborted: migration out: canceled by client
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.