From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBov9-0004fc-UX for qemu-devel@nongnu.org; Thu, 06 Oct 2011 10:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBov9-0007sR-0O for qemu-devel@nongnu.org; Thu, 06 Oct 2011 10:27:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBov8-0007sM-MC for qemu-devel@nongnu.org; Thu, 06 Oct 2011 10:27:34 -0400 Message-ID: <4E8DBAD0.7070406@redhat.com> Date: Thu, 06 Oct 2011 16:27:28 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1317729885-17534-1-git-send-email-pbonzini@redhat.com> <20111005113707.5312f98b@doriath> <4E8C7B1C.2020808@redhat.com> <4E8C8656.3040706@web.de> <4E8C87DF.5080201@redhat.com> <4E8C8A9C.7090506@web.de> <4E8C9018.5000908@redhat.com> <4E8C9BBB.7040804@web.de> In-Reply-To: <4E8C9BBB.7040804@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] runstate: do not discard runstate changes when paused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Paolo Bonzini , qemu-devel@nongnu.org, Luiz Capitulino On 10/05/2011 08:02 PM, Jan Kiszka wrote: > > > > Let's examine a concrete example: a user is debugging a guest, which > > stops at a breakpoint. Meanwhile a live migration is going on, > > involving internal stops. When the guest does manage to run for a bit, > > it runs out of disk space, generating a stop, which the management agent > > resolves by allocating more space and issuing a cont. > > > > With a counting cont, no matter in what order these events happen, > > things work out fine. How do they work out with your proposal? > > We can enforce stop for temporal reasons (migration/savevm), something > that overrules user/management initiated stops. Migration resume shouldn't overrule user stop. It's really simple. If any agent wants the system stopped, it's stopped. Only when no one wants it stopped, it may run. > > BTW, does stop due to migration actually have a window where it accepts > other commands? I thought that phase is synchronous. Then we would just > have to implement proper state saving/restoring. Save: ++stop_count, restore: --stop_count. > > Anyway, there is no point in lock counting for stop reasons that require > external synchronization anyway. gdb vs. management stack vs. human > monitor - nothing is solved by counting the stops, they all can step on > each other's shoes. Please elaborate. > Even worse, exposing a counting stop via the user > interface requires additional interfaces to recover lost or forgotten > locks. We've discussed this in the past IIRC. > Agree with that. So there's the second proposal: vm_stop(unsigned reason) { if (!stop_state) { do_vm_stop(); } stop_state |= 1 << reason; } vm_resume(unsigned reason) { stop_state &= ~(1 << reason); if (!stop_state) { do_vm_resume(); } } so now each agent is separated from the other. -- error compiling committee.c: too many arguments to function