From patchwork Wed Jun 20 04:47:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 165882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2691EB6FBD for ; Wed, 20 Jun 2012 15:14:16 +1000 (EST) Received: from localhost ([::1]:40745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShCpr-0002ML-Rw for incoming@patchwork.ozlabs.org; Wed, 20 Jun 2012 00:48:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShCpR-0001M0-T5 for qemu-devel@nongnu.org; Wed, 20 Jun 2012 00:47:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShCpO-00031p-Hl for qemu-devel@nongnu.org; Wed, 20 Jun 2012 00:47:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShCpO-00031I-8Z for qemu-devel@nongnu.org; Wed, 20 Jun 2012 00:47:38 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5K4laUT010147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Jun 2012 00:47:36 -0400 Received: from dhcp-8-167.nay.redhat.com ([10.66.7.126]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5K4lFd2023684; Wed, 20 Jun 2012 00:47:34 -0400 From: Amos Kong To: aliguori@us.ibm.com, eblake@redhat.com, berrange@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org Date: Wed, 20 Jun 2012 12:47:41 +0800 Message-Id: <1340167661-25499-7-git-send-email-akong@redhat.com> In-Reply-To: <1340167661-25499-1-git-send-email-akong@redhat.com> References: <1340167661-25499-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amos Kong Subject: [Qemu-devel] [PATCH v3 6/6] ps2: output warning when event queue full X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;