qemu: fix domjobabort regression
qemu: fix domjobabort regression

This reverts commit ef1065cf5ac; see also this bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=751900

In qemu 0.15.1 and earlier, during migration to file, the
qemu_savevm_state_begin and qemu_savevm_state_iterate methods
will both process as much migration data as possible until either

  1. The file descriptor returns EAGAIN
  2. The bandwidth rate limit is reached

If we set the rate limit to ULONG_MAX, test 2 never becomes true. We're
passing a plain file descriptor to QEMU and POSIX does not support EAGAIN on
regular files / block devices, so test 1 never becomes true either.

In the 'virsh save --bypass-cache' case, we pass a pipe instead of a
regular fd, but using a pipe adds I/O overhead, so always passing a
pipe just so qemu can see EAGAIN doesn't seem nice.

The ultimate fix needs to come from qemu - background migration must
respect asynchronous abort requests, or else periodically return
control to the main handling loop without an EAGAIN and without
waiting to hit an insanely large amount of data.  But until a
version of qemu is fixed to support "unlimited" data rates while
still allowing cancellation, the best we can do is avoid the
automatic use of unlimited rates from within libvirt (users can
still explicitly change the migration rates, if they are aware that
they are giving up the ability to cancel a job).

Reverting the lone use of QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX is
the simplest patch; this slows migration back down to a default
32M/sec cap, but also ensures that the main qemu processing loop
will still be responsive to cancellation requests.  Hopefully
upstream qemu will provide us a means of safely using unlimited
speed, including a runtime probe of that capability.

* src/qemu/qemu_migration.c (qemuMigrationToFile): Revert attempt
to use unlimited migration bandwidth when migrating to file.

Signed-off-by: Daniel Veillard <8c3f1b821d9adf233f787f1527ecaa1537ea24a2@redhat.com>
Signed-off-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>

jardasgit/libvirt,taget/libvirt,emaste/libvirt,VenkatDatta/libvirt,wiedi/libvirt,cbosdo/libvirt,rmarwaha/libvirt1,shugaoye/libvirt,andreabolognani/libvirt,rmarwaha/libvirt,jeckersb/libvirt,nertpinx/libvirt,trainstack/libvirt,taget/libvirt,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,zhlcindy/libvirt-1.1.4-maintain,fabianfreyer/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,olafhering/libvirt,rlaager/libvirt,agx/libvirt,nertpinx/libvirt,danwent/libvirt-ovs,fabianfreyer/libvirt,nertpinx/libvirt,jardasgit/libvirt,shugaoye/libvirt,zippy2/libvirt,usc-isi/libvirt,dumbbell/libvirt,jardasgit/libvirt,rmarwaha/libvirt,leilihh/libvirt,wiedi/libvirt,elmarco/libvirt,trainstack/libvirt,usc-isi/libvirt,dumbbell/libvirt,cbosdo/libvirt,iam-TJ/libvirt,wiedi/libvirt,elmarco/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,eskultety/libvirt,bjzhang/libvirt,bjzhang/libvirt,emaste/libvirt,novel/fbsd-libvirt,foomango/libvirt,novel/fbsd-libvirt,cbosdo/libvirt,warewolf/libvirt,novel/fbsd-libvirt,crobinso/libvirt,agx/libvirt,zippy2/libvirt,leilihh/libvirt,usc-isi/libvirt,iam-TJ/libvirt,nertpinx/libvirt,dumbbell/libvirt,emaste/libvirt,danwent/libvirt-ovs,agx/libvirt,zhlcindy/libvirt-1.1.4-maintain,rlaager/libvirt,emaste/libvirt,rmarwaha/libvirt,cbosdo/libvirt,danwent/libvirt-ovs,libvirt/libvirt,siboulet/libvirt-openvz,fabianfreyer/libvirt,shugaoye/libvirt,shugaoye/libvirt,siboulet/libvirt-openvz,trainstack/libvirt,dumbbell/libvirt,agx/libvirt,rmarwaha/libvirt1,jeckersb/libvirt,bjzhang/libvirt,wiedi/libvirt,novel/fbsd-libvirt,elmarco/libvirt,danwent/libvirt-ovs,datto/libvirt,zhlcindy/libvirt-1.1.4-maintain,bjzhang/libvirt,VenkatDatta/libvirt,warewolf/libvirt,datto/libvirt,libvirt/libvirt,datto/libvirt,wiedi/libvirt,warewolf/libvirt,siboulet/libvirt-openvz,warewolf/libvirt,emaste/libvirt,usc-isi/libvirt,olafhering/libvirt,jeckersb/libvirt,VenkatDatta/libvirt,eskultety/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,foomango/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,novel/fbsd-libvirt,eskultety/libvirt,rmarwaha/libvirt1,foomango/libvirt,crobinso/libvirt,jfehlig/libvirt,iam-TJ/libvirt,rlaager/libvirt,rmarwaha/libvirt,taget/libvirt,libvirt/libvirt,warewolf/libvirt,crobinso/libvirt,jeckersb/libvirt,libvirt/libvirt,elmarco/libvirt,taget/libvirt,rmarwaha/libvirt1,agx/libvirt,jeckersb/libvirt,emaste/libvirt,jeckersb/libvirt,leilihh/libvirt,rlaager/libvirt,iam-TJ/libvirt,wiedi/libvirt,taget/libvirt,nertpinx/libvirt,leilihh/libvirt,rmarwaha/libvirt,jfehlig/libvirt,olafhering/libvirt,wiedi/libvirt,VenkatDatta/libvirt,siboulet/libvirt-openvz,rmarwaha/libvirt1,zippy2/libvirt,novel/fbsd-libvirt,trainstack/libvirt,foomango/libvirt,danwent/libvirt-ovs,trainstack/libvirt,trainstack/libvirt,usc-isi/libvirt,zhlcindy/libvirt-1.1.4-maintain,jeckersb/libvirt,leilihh/libvirt,rlaager/libvirt,leilihh/libvirt,dumbbell/libvirt,emaste/libvirt,crobinso/libvirt,warewolf/libvirt,shugaoye/libvirt,jfehlig/libvirt,elmarco/libvirt,foomango/libvirt,novel/fbsd-libvirt,datto/libvirt,eskultety/libvirt,datto/libvirt,warewolf/libvirt,dumbbell/libvirt,olafhering/libvirt,eskultety/libvirt,rmarwaha/libvirt,iam-TJ/libvirt,bjzhang/libvirt,VenkatDatta/libvirt,zippy2/libvirt,rmarwaha/libvirt1,andreabolognani/libvirt,iam-TJ/libvirt,trainstack/libvirt,cbosdo/libvirt,siboulet/libvirt-openvz,novel/fbsd-libvirt,jardasgit/libvirt