diff mbox

[RFC,v2,6/6] keymaps: convert fprintf to qerror_report

Message ID 1417589746-12176-7-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) Dec. 3, 2014, 6:55 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Only report the first error to QMP monitor.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 ui/keymaps.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ui/keymaps.c b/ui/keymaps.c
index 49410ae..47471d1 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -24,6 +24,7 @@ 
 
 #include "keymaps.h"
 #include "sysemu/sysemu.h"
+#include "monitor/monitor.h"
 
 static int get_keysym(const name2keysym_t *table,
                       const char *name)
@@ -104,7 +105,8 @@  static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table,
     f = filename ? fopen(filename, "r") : NULL;
     g_free(filename);
     if (!f) {
-        fprintf(stderr, "Could not read keymap file: '%s'\n", language);
+        qerror_report(ERROR_CLASS_GENERIC_ERROR,
+                      "Could not read keymap file: '%s'", language);
         return NULL;
     }