diff options
author | Cao jin <caoj.fnst@cn.fujitsu.com> | 2016-01-17 20:13:12 +0800 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-01-21 16:45:34 +0000 |
commit | 376ba75f88681b468caf4f6bcf27cf8a4b17a6d0 (patch) | |
tree | 97fa2c9615c2cbc14460a91fc5e26b1897d622d9 /hw/xen/xen_pt.c | |
parent | f524bc3b3da5bd595840fca93d43a9852b8d066f (diff) | |
download | qemu-376ba75f88681b468caf4f6bcf27cf8a4b17a6d0.zip qemu-376ba75f88681b468caf4f6bcf27cf8a4b17a6d0.tar.gz qemu-376ba75f88681b468caf4f6bcf27cf8a4b17a6d0.tar.bz2 |
Add Error **errp for xen_host_pci_device_get()
To catch the error message. Also modify the caller
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw/xen/xen_pt.c')
-rw-r--r-- | hw/xen/xen_pt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index aa96288..53b5bca 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -767,6 +767,7 @@ static int xen_pt_initfn(PCIDevice *d) uint8_t machine_irq = 0, scratch; uint16_t cmd = 0; int pirq = XEN_PT_UNASSIGNED_PIRQ; + Error *err = NULL; /* register real device */ XEN_PT_LOG(d, "Assigning real physical device %02x:%02x.%d" @@ -774,11 +775,13 @@ static int xen_pt_initfn(PCIDevice *d) s->hostaddr.bus, s->hostaddr.slot, s->hostaddr.function, s->dev.devfn); - rc = xen_host_pci_device_get(&s->real_device, - s->hostaddr.domain, s->hostaddr.bus, - s->hostaddr.slot, s->hostaddr.function); - if (rc) { - XEN_PT_ERR(d, "Failed to \"open\" the real pci device. rc: %i\n", rc); + xen_host_pci_device_get(&s->real_device, + s->hostaddr.domain, s->hostaddr.bus, + s->hostaddr.slot, s->hostaddr.function, + &err); + if (err) { + error_append_hint(&err, "Failed to \"open\" the real pci device"); + error_report_err(err); return -1; } |