Received: from eggs.gnu.org ([2001:4830:134:3::10]:48253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3L9f-00053z-FU for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3L9d-0005RY-GB for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:10 -0400 Received: from mail-qg0-x241.google.com ([2607:f8b0:400d:c04::241]:32980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3L9d-0005RU-Bi for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:09 -0400 Received: by mail-qg0-x241.google.com with SMTP id 90so6455887qgz.0 for ; Thu, 19 May 2016 03:26:09 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Thu, 19 May 2016 12:25:56 +0200 Message-Id: <1463653560-26958-3-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1463653560-26958-1-git-send-email-marcandre.lureau@redhat.com> References: <1463653560-26958-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 2/6] virtio-vga: propagate on gpu realized error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/display/virtio-gpu-3d.c | 1 + hw/display/virtio-vga.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index fa19294..20e8865 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -17,6 +17,7 @@ #include "trace.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-gpu.h" +#include "qapi/error.h" #ifdef CONFIG_VIRGL diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index e58b165..f49f8de 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -4,6 +4,7 @@ #include "ui/console.h" #include "vga_int.h" #include "hw/virtio/virtio-pci.h" +#include "qapi/error.h" /* * virtio-vga: This extends VirtioPCIProxy. @@ -89,6 +90,7 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp) VirtIOVGA *vvga = VIRTIO_VGA(vpci_dev); VirtIOGPU *g = &vvga->vdev; VGACommonState *vga = &vvga->vga; + Error *err = NULL; uint32_t offset; int i; @@ -124,7 +126,11 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp) /* force virtio-1.0 */ vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODERN; vpci_dev->flags |= VIRTIO_PCI_FLAG_DISABLE_LEGACY; - object_property_set_bool(OBJECT(g), true, "realized", errp); + object_property_set_bool(OBJECT(g), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } /* add stdvga mmio regions */ pci_std_vga_mmio_region_init(vga, &vpci_dev->modern_bar, -- 2.7.4