aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2014-04-10 10:24:32 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-05-08 14:19:59 -0400
commitcf10a5b18f4eb25004cffde15c770dadaa3c4bde (patch)
tree0fb02608c824e97bae7df77815c99d6b0234395d /hw
parent5906366ef0474691e9cfd9aa54a525d43bd2df43 (diff)
pci-assign: accept Error from monitor_handle_fd_param2()
Propagate any errors in monitor fd handling up to get_real_device(), and report them there. We'll continue the propagation upwards when get_real_device() becomes a leaf itself (when none of its callees will report errors internally any longer when detecting and returning an error). Signed-off-by: Laszlo Ersek <lersek@redhat.com> eviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/i386/kvm/pci-assign.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index a825871d8a..bfce97fcca 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -541,6 +541,7 @@ static int get_real_device(AssignedDevice *pci_dev)
uint16_t id;
PCIRegion *rp;
PCIDevRegions *dev = &pci_dev->real_device;
+ Error *local_err = NULL;
dev->region_number = 0;
@@ -551,8 +552,12 @@ static int get_real_device(AssignedDevice *pci_dev)
snprintf(name, sizeof(name), "%sconfig", dir);
if (pci_dev->configfd_name && *pci_dev->configfd_name) {
- dev->config_fd = monitor_handle_fd_param(cur_mon, pci_dev->configfd_name);
- if (dev->config_fd < 0) {
+ dev->config_fd = monitor_handle_fd_param2(cur_mon,
+ pci_dev->configfd_name,
+ &local_err);
+ if (local_err) {
+ qerror_report_err(local_err);
+ error_free(local_err);
return 1;
}
} else {