From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPeOK-00019R-Od for qemu-devel@nongnu.org; Wed, 02 May 2012 14:35:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPeOI-0003Va-Tw for qemu-devel@nongnu.org; Wed, 02 May 2012 14:35:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPeOI-0003Qj-CM for qemu-devel@nongnu.org; Wed, 02 May 2012 14:35:06 -0400 Date: Wed, 2 May 2012 15:34:53 -0300 From: Luiz Capitulino Message-ID: <20120502153453.3ee5dc8e@doriath.home> In-Reply-To: <4FA0DD87.6080302@redhat.com> References: <1335559216-13849-1-git-send-email-lcapitulino@redhat.com> <1335559216-13849-3-git-send-email-lcapitulino@redhat.com> <4FA0DD87.6080302@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] runstate: introduce suspended state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Wed, 02 May 2012 09:08:55 +0200 Gerd Hoffmann wrote: > > diff --git a/input.c b/input.c > > index 6b5c2c3..47e6900 100644 > > --- a/input.c > > +++ b/input.c > > @@ -130,7 +130,7 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry) > > > > void kbd_put_keycode(int keycode) > > { > > - if (!runstate_is_running()) { > > + if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { > > return; > > } > > if (qemu_put_kbd_event) { > > IIRC there is a simliar check for the mouse ... Will add. > Does it make sense to add a runstate_is_running_or_suspended() function? I think that the question we have to answer is: apart from the keyboard and mouse, is there any device that wants to run while qemu is suspended? If this is true only for the keyboard and mouse, then having the above check is fine. Now, if this is the case for several devices then we might need a different solution, as this patch will brake them.