From patchwork Thu Aug 9 11:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10561283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 575D11057 for ; Thu, 9 Aug 2018 11:55:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45D7F2AED5 for ; Thu, 9 Aug 2018 11:55:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39B342AEE1; Thu, 9 Aug 2018 11:55:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5FB212AED5 for ; Thu, 9 Aug 2018 11:55:11 +0000 (UTC) Received: from localhost ([::1]:50054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjX4-0003iy-4s for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Aug 2018 07:55:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjPN-0004ko-LG for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjPL-00075j-2U for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:13 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:36706) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjPK-00075Q-Oz for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:47:10 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79BiX19178063; Thu, 9 Aug 2018 11:47:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=5T19qxT2gU0iqZIVEcgtxYkNh5RFpbn/swl9iA0EVTM=; b=jqyXflVbdS2EpZtb0SaYimFZngWtjO69Z4r00ntvk6jMbEb31EDdDLDVO1kCORQ6hWUc CmxEpscUSy/M9Vf/mcYOupDvZLEovDp+3TStnWTT2bESCZpgUNh4m3yvrstJ5gdlfGpa aIXHeaAGhJez0phHJg5opIjejX4eyKVLx7eTu7pzYUejltS67zyTS0+Ger0HvibcWdkf cZcms9fvV9xgFKZLIUUtWEohm3He+17Yh0NfYmgWJAbA6G0T0uB52+ExBEZbqjgwMLyg 1nsLOR9G4JKtSFKW3fjbRGNw1ChVg0Ab2ChccgtMjIHAzU14qEhvvTyAlD2247IooYPL /g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2kn43p2uvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:47:09 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w79Bl8A3016517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:47:09 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w79Bl8mb019798; Thu, 9 Aug 2018 11:47:08 GMT Received: from liran-pc.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Aug 2018 04:47:07 -0700 From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:17 +0300 Message-Id: <1533815202-11967-5-git-send-email-liran.alon@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> References: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8979 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808090123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 Subject: [Qemu-devel] [PATCH 04/29] vmsvga: Do not print error message for ignored commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: habkost@redhat.com, mtosatti@redhat.com, Liran Alon , kraxel@redhat.com, pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Future patches will add handling of commands that are parsed but deliberately ignored. This change adds required framework for avoiding printing parsing error messages for these commands, when we encounter them in the FIFO. Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index a244f43a866f..2e6ac5dfad8a 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -600,11 +600,13 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) int x, y, dx, dy, width, height; struct vmsvga_cursor_definition_s cursor; uint32_t cmd_start; + bool cmd_ignored; len = vmsvga_fifo_length(s); while (len > 0 && --maxloop > 0) { /* May need to go back to the start of the command if incomplete */ cmd_start = s->fifo_stop; + cmd_ignored = false; switch (cmd = vmsvga_fifo_read(s)) { @@ -759,6 +761,9 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) default: args = 0; + goto badcmd; + ignoredcmd: + cmd_ignored = true; badcmd: len -= args; if (len < 0) { @@ -767,8 +772,10 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s) while (args--) { vmsvga_fifo_read(s); } - printf("%s: Unknown command 0x%02x in SVGA command FIFO\n", - __func__, cmd); + if (!cmd_ignored) { + printf("%s: Unknown command 0x%02x in SVGA command FIFO\n", + __func__, cmd); + } break; rewind: