Created attachment 639477 [details]
Description of problem:
I cancelled migration of a vm right after it started and migration continued.
Michal looked at the logs and determined that vdsm isued 'migrate_cancel' before libvirt gets to 'migrate'
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. migrate a vm from one host to a second host
2. cancel migration right at the beginning of the migration
migration should be cancelled.
Additional info: logs
This is race. The first thread (the one that starts migration) sets job and is preparing to issue monitor commands to qemu. However, meanwhile second thread jumps in and since the job is already set, it cancels the job, issue 'migrate_cancel' and quit. Right after the first thread finished preparation and starts the migration (executes 'migrate' on the monitor).
This is also tracked upstream in bug 728904.
Patch proposed upstream:
I can reproduce with
# virsh migrate --live vr-rhel6u3-x86_64-kvm qemu+ssh://10.66.84.16/system --verbose & usleep 700000; virsh domjobabort vr-rhel6u3-x86_64-kvm; echo "$?"
domjobabort return 0 but migration continued
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.