Re: [PATCH 1/5] Support for vm_stop from the migration thread

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

 



On 08/29/2011 06:56 PM, Marcelo Tosatti wrote:
>  diff --git a/cpus.c b/cpus.c
>  index de70e02..f35f683 100644
>  --- a/cpus.c
>  +++ b/cpus.c
>  @@ -122,8 +122,8 @@ static void do_vm_stop(int reason)
>    {
>        if (vm_running) {
>            cpu_disable_ticks();
>  -        vm_running = 0;
>            pause_all_vcpus();
>  +        vm_running = 0;
>            vm_state_notify(0, reason);
>            qemu_aio_flush();
>            bdrv_flush_all();
Why this change?

Without it, you could have two threads calling into do_vm_stop and the second would not wait for all CPUs to be paused. Still not perfect as you'd get double notifications, you would need a condition variable or QemuEvent (from the RCU series) for that.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux