On 01/16/2014 09:23 AM, Joaquim Barrera wrote:> Hello everyone,
>
> Can somebody point where I can find the code where libvirt makes the
> decision to complete a live migration?
Libvirt doesn't make the decision, qemu does. So you'll have to look in
the qemu code. Libvirt just reacts to the change in state reported by
qemu when the decision to pause the guest on the source has already
occurred, and uses that to tell the guest on the destination to start
running.
>
> I mean, at some point syncronising the VM state, it has to decide that
> the delta left to be migrate is low enough to achieve downtime 0, so
> libvirt finishes the migration. This "low enough" must be defined
> somewhere in the code, but I am unable to find it.
You can also tune the threshold on the fly (see
virDomainMigrateSetMaxDowntime) or even force the transition immediately
(convert from a live migration to a paused migration, so that the
current delta remaining is now sent in a final pass; useful if live
migration never makes enough progress to converge over to the final
paused migration on its own - see how 'virsh migrate --timeout' is
implemented).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org