[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/24] vl: Use error_report() for --display errors
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 16/24] vl: Use error_report() for --display errors |
Date: |
Mon, 22 Jun 2015 21:04:41 +0200 |
Results in nicer error messages. Before this patch:
Invalid GTK option string: gtk,lirum-larum
After:
qemu-system-x86_64: -display gtk,lirum-larum: Invalid GTK option string
Of course, the thing ought to use QemuOpts instead of parsing by hand.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
---
vl.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index 54ef869..33b0d86 100644
--- a/vl.c
+++ b/vl.c
@@ -2098,13 +2098,13 @@ static DisplayType select_display(const char *p)
}
} else {
invalid_sdl_args:
- fprintf(stderr, "Invalid SDL option string: %s\n", p);
+ error_report("Invalid SDL option string");
exit(1);
}
opts = nextopt;
}
#else
- fprintf(stderr, "SDL support is disabled\n");
+ error_report("SDL support is disabled");
exit(1);
#endif
} else if (strstart(p, "vnc", &opts)) {
@@ -2115,18 +2115,18 @@ static DisplayType select_display(const char *p)
exit(1);
}
} else {
- fprintf(stderr, "VNC requires a display argument vnc=<display>\n");
+ error_report("VNC requires a display argument vnc=<display>");
exit(1);
}
#else
- fprintf(stderr, "VNC support is disabled\n");
+ error_report("VNC support is disabled");
exit(1);
#endif
} else if (strstart(p, "curses", &opts)) {
#ifdef CONFIG_CURSES
display = DT_CURSES;
#else
- fprintf(stderr, "Curses support is disabled\n");
+ error_report("Curses support is disabled");
exit(1);
#endif
} else if (strstart(p, "gtk", &opts)) {
@@ -2155,19 +2155,19 @@ static DisplayType select_display(const char *p)
}
} else {
invalid_gtk_args:
- fprintf(stderr, "Invalid GTK option string: %s\n", p);
+ error_report("Invalid GTK option string");
exit(1);
}
opts = nextopt;
}
#else
- fprintf(stderr, "GTK support is disabled\n");
+ error_report("GTK support is disabled");
exit(1);
#endif
} else if (strstart(p, "none", &opts)) {
display = DT_NONE;
} else {
- fprintf(stderr, "Unknown display type: %s\n", p);
+ error_report("Unknown display type");
exit(1);
}
--
1.9.3
- [Qemu-devel] [PULL 06/24] monitor: Fix failure path for "S" argument, (continued)
- [Qemu-devel] [PULL 06/24] monitor: Fix failure path for "S" argument, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 12/24] qdev-monitor: Propagate errors through set_property(), Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 04/24] monitor: cleanup parsing of cmd name and cmd arguments, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 10/24] qdev-monitor: Fix check for full bus, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 09/24] qdev-monitor: Stop error avalanche in qbus_find_recursive(), Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 13/24] qdev-monitor: Propagate errors through qdev_device_add(), Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 15/24] vl: Avoid qerror_report() outside QMP command handlers, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 11/24] qdev-monitor: Convert qbus_find() to Error, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 01/24] qobject: Use 'bool' for qbool, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 02/24] qobject: Use 'bool' inside qdict, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 16/24] vl: Use error_report() for --display errors,
Markus Armbruster <=
- [Qemu-devel] [PULL 17/24] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 07/24] monitor: Split mon_get_cpu fn to remove ENV_GET_CPU, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 23/24] Include qapi/qmp/qerror.h exactly where needed, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 22/24] qerror: Move #include out of qerror.h, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 21/24] qerror: Finally unused, clean up, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 19/24] tpm: Avoid qerror_report() outside QMP command handlers, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 20/24] qmp: Wean off qerror_report(), Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 24/24] Include monitor/monitor.h exactly where needed, Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 14/24] QemuOpts: Wean off qerror_report_err(), Markus Armbruster, 2015/06/22
- [Qemu-devel] [PULL 08/24] disas: Remove uses of CPU env, Markus Armbruster, 2015/06/22