From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuG0H-0008Or-72 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuG0G-0006lF-7e for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuG0F-0006l9-Vr for qemu-devel@nongnu.org; Thu, 26 Jul 2012 00:48:48 -0400 From: Amos Kong Date: Thu, 26 Jul 2012 12:49:00 +0800 Message-Id: <1343278141-10843-6-git-send-email-akong@redhat.com> In-Reply-To: <1343278141-10843-1-git-send-email-akong@redhat.com> References: <1343278141-10843-1-git-send-email-akong@redhat.com> Subject: [Qemu-devel] [PATCH v5 5/6] ps2: output warning when event queue full List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, Amos Kong , eblake@redhat.com, lcapitulino@redhat.com Event would be ignored if ps2 queue is full, this patch added a warning in ignore path. Signed-off-by: Amos Kong --- hw/ps2.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/ps2.c b/hw/ps2.c index f93cd24..799c36b 100644 --- a/hw/ps2.c +++ b/hw/ps2.c @@ -137,8 +137,10 @@ void ps2_queue(void *opaque, int b) PS2State *s = (PS2State *)opaque; PS2Queue *q = &s->queue; - if (q->count >= PS2_QUEUE_SIZE) + if (q->count >= PS2_QUEUE_SIZE) { + fprintf(stderr, "ps2: warning: event queue full\n"); return; + } q->data[q->wptr] = b; if (++q->wptr == PS2_QUEUE_SIZE) q->wptr = 0; -- 1.7.1