From 6832deb8ff0807e0b46a8a67f5d2abfa36ca3b47 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 17 Mar 2022 09:30:25 +0100 Subject: hw/display: Allow vga_common_init() to return errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vga_common_init() function currently cannot report errors to its caller. But in the following patch, we'd need this possibility, so let's change it to take an "Error **" as parameter for this. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220317083027.16688-3-thuth@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/display/qxl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hw/display/qxl.c') diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 1f9ad31943..adbdbcaeb6 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2215,7 +2215,11 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp) qxl_init_ramsize(qxl); vga->vbe_size = qxl->vgamem_size; vga->vram_size_mb = qxl->vga.vram_size / MiB; - vga_common_init(vga, OBJECT(dev)); + vga_common_init(vga, OBJECT(dev), &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } vga_init(vga, OBJECT(dev), pci_address_space(dev), pci_address_space_io(dev), false); portio_list_init(&qxl->vga_port_list, OBJECT(dev), qxl_vga_portio_list, -- cgit 1.4.1