vga: don't abort when adding a duplicate isa-vga device
authorJose R. Ziviani <jziviani@suse.de>
Tue, 17 Aug 2021 19:26:29 +0000 (16:26 -0300)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 31 Aug 2021 12:32:28 +0000 (14:32 +0200)
commit7852a77f598635a67a222b6c1463c8b46098aed2
tree8101e5c096c53f2d64bc0f2e48d9f55d8c9b4a4c
parentb956577af1b88e950bf2aa5f77be6c8aee04e879
vga: don't abort when adding a duplicate isa-vga device

If users try to add an isa-vga device that was already registered,
still in command line, qemu will crash:

$ qemu-system-mips64el -M pica61 -device isa-vga
RAMBlock "vga.vram" already registered, abort!
Aborted (core dumped)

That particular board registers the device automaticaly, so it's
not obvious that a VGA device already exists. This patch changes
this behavior by displaying a message and exiting without crashing.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/44
Signed-off-by: Jose R. Ziviani <jziviani@suse.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210817192629.12755-1-jziviani@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/vga-isa.c