[15/19] console: Chardev open error reporting, console part

Message ID 1328623766-12287-16-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Feb. 7, 2012, 2:09 p.m.
Unlike many other backends, this one leaves open error reporting to
its caller.  Because the caller doesn't know what went wrong, this
results in a pretty useless error message.

Change it to report its errors.  Improves the message you get when
attempting to create too many consoles from

    chardev: opening backend "vc" failed


    qemu-system-x86_64: -chardev vc,id=c13: Can't create more than 12 consoles
    chardev: opening backend "vc" failed

The useless "opening backend failed" message will be cleaned up

Signed-off-by: Markus Armbruster <armbru@redhat.com>
 console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/console.c b/console.c
index 744ef2d..f6b93bd 100644
--- a/console.c
+++ b/console.c
@@ -1529,8 +1529,8 @@  CharDriverState *text_console_init(QemuOpts *opts)
     } else {
         s = new_console(NULL, TEXT_CONSOLE_FIXED_SIZE);
     if (!s) {
+        error_report("Can't create more than %d consoles", MAX_CONSOLES);
         return NULL;