From 6e1db57b2ac9025c2443c665a0d9e78748637b26 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 1 Jun 2011 13:29:11 +0200 Subject: qemu-char: Print strerror message on failure The only way for chardev drivers to communicate an error was to return a NULL pointer, which resulted in an error message that said _that_ something went wrong, but not _why_. This patch changes the interface to return 0/-errno and updates qemu_chr_open_opts to use strerror to display a more helpful error message. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'console.h') diff --git a/console.h b/console.h index 64d1f090e..c09537b86 100644 --- a/console.h +++ b/console.h @@ -354,7 +354,7 @@ void vga_hw_text_update(console_ch_t *chardata); int is_graphic_console(void); int is_fixedsize_console(void); -CharDriverState *text_console_init(QemuOpts *opts); +int text_console_init(QemuOpts *opts, CharDriverState **_chr); void text_consoles_set_display(DisplayState *ds); void console_select(unsigned int index); void console_color_init(DisplayState *ds); -- cgit v1.2.3