From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmLLS-0008R6-RQ for qemu-devel@nongnu.org; Fri, 29 Nov 2013 05:30:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmLLJ-00015L-1G for qemu-devel@nongnu.org; Fri, 29 Nov 2013 05:30:46 -0500 Received: from mail-ie0-x22a.google.com ([2607:f8b0:4001:c03::22a]:43872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmLLI-000158-Sd for qemu-devel@nongnu.org; Fri, 29 Nov 2013 05:30:36 -0500 Received: by mail-ie0-f170.google.com with SMTP id qd12so16093755ieb.1 for ; Fri, 29 Nov 2013 02:30:36 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52986CC7.1090100@redhat.com> Date: Fri, 29 Nov 2013 11:30:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1384777531-14635-1-git-send-email-marcandre.lureau@gmail.com> <1384777531-14635-20-git-send-email-marcandre.lureau@gmail.com> In-Reply-To: <1384777531-14635-20-git-send-email-marcandre.lureau@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 19/21] sysemu: add vm_start_hold/release List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, spice-devel@freedesktop.org Il 18/11/2013 13:25, Marc-André Lureau ha scritto: > +static int start_hold; > + > +void vm_start_hold(void) > +{ > + start_hold++; > +} > + > +void vm_start_release(void) > +{ > + start_hold--; > + vm_start(); > +} > + > void vm_start(void) > { > + if (start_hold != 0) { > + return; > + } > + This is interesting. I like it, but I think this sequence: vm_start_hold() vm_start_release() should not call vm_start(), while this: vm_start_hold() vm_start() vm_start_release() should call it. Also, vm_start_hold() should assert that the VM is not running. Paolo