mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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 <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
84682834eb
commit
6e1db57b2a
8 changed files with 117 additions and 83 deletions
|
@ -64,7 +64,7 @@ static void msmouse_chr_close (struct CharDriverState *chr)
|
|||
qemu_free (chr);
|
||||
}
|
||||
|
||||
CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts)
|
||||
int qemu_chr_open_msmouse(QemuOpts *opts, CharDriverState **_chr)
|
||||
{
|
||||
CharDriverState *chr;
|
||||
|
||||
|
@ -74,5 +74,6 @@ CharDriverState *qemu_chr_open_msmouse(QemuOpts *opts)
|
|||
|
||||
qemu_add_mouse_event_handler(msmouse_event, chr, 0, "QEMU Microsoft Mouse");
|
||||
|
||||
return chr;
|
||||
*_chr = chr;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue