diff mbox series

[04/29] vmsvga: Do not print error message for ignored commands

Message ID 1533815202-11967-5-git-send-email-liran.alon@oracle.com (mailing list archive)
State New, archived
Headers show
Series : vmsvga: Various fixes and enhancements | expand

Commit Message

Liran Alon Aug. 9, 2018, 11:46 a.m. UTC
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 <darren.kenny@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
---
 hw/display/vmware_vga.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

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: