Re: [PATCH] migration: Fix possible bug for migrate cancel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 28/03/2014 10:18, Gonglei (Arei) ha scritto:
> > Can you please give more details at how you are triggering the problem
> > with libvirt?  I think Paolo is probably right - the bug is more likely
> > to be in libvirt not expecting the race and not recovering correctly
> > when the race occurs, than it is to be in changing qemu's state algorithm.
> >
When the migration progress reaches 100%, and the migration status becomes
MIG_STATE_COMPLETED in Qemu.
It will take some time which from MIG_STATE_COMPLETED to the migration
thread resources are recovered.
If we cancel the migration at this moment, the migrate_fd_cancel function will
break directly without reporting
error code. Then, libvirt considers the cancle operation a success, contrary
facts.

There is no error, once migration is completed you can still shutdown on the destination and continue on the source. Libvirt should either:

1) poll with "query-migrate" after migrate_cancel, and report an error there if it's the desired semantics;

2) toggle a "cancelled" flag before asking QEMU to cancel migration, check it in the migration functions after "query-migrate" reported completion; if it is true, do not resume on the destination.

Another reason for doing it in libvirt is that the serialization between cancellation and completion of migration ultimately is controlled by libvirt's lock. Doing this in QEMU makes it harder to reason about concurrency.

Paolo

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]