mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
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>
This commit is contained in:
parent
f524bc3b3d
commit
376ba75f88
3 changed files with 68 additions and 52 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue