|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 1/5] Support for vm_stop from the migration thread |
Date: | Tue, 30 Aug 2011 10:40:41 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |