diff options
author | Cao jin <caoj.fnst@cn.fujitsu.com> | 2016-01-17 20:13:13 +0800 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-01-21 16:45:41 +0000 |
commit | 5226bb59f703963914e446557a2eea4a82eaf462 (patch) | |
tree | db3e5e299b50e9a2cdcdbbee6b48e8bbd0318be2 /hw/xen/xen_pt_graphics.c | |
parent | 376ba75f88681b468caf4f6bcf27cf8a4b17a6d0 (diff) |
Add Error **errp for xen_pt_setup_vga()
To catch the error message. Also modify the caller
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'hw/xen/xen_pt_graphics.c')
-rw-r--r-- | hw/xen/xen_pt_graphics.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index df6069bf63..e7a7c7e263 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -161,7 +161,8 @@ struct pci_data { uint16_t reserved; } __attribute__((packed)); -int xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev) +void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev, + Error **errp) { unsigned char *bios = NULL; struct rom_header *rom; @@ -172,13 +173,14 @@ int xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev) struct pci_data *pd = NULL; if (!is_igd_vga_passthrough(dev)) { - return -1; + error_setg(errp, "Need to enable igd-passthrough"); + return; } bios = get_vgabios(s, &bios_size, dev); if (!bios) { - XEN_PT_ERR(&s->dev, "VGA: Can't getting VBIOS!\n"); - return -1; + error_setg(errp, "VGA: Can't get VBIOS"); + return; } /* Currently we fixed this address as a primary. */ @@ -203,7 +205,6 @@ int xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev) /* Currently we fixed this address as a primary for legacy BIOS. */ cpu_physical_memory_rw(0xc0000, bios, bios_size, 1); - return 0; } uint32_t igd_read_opregion(XenPCIPassthroughState *s) |