Received: from eggs.gnu.org ([2001:4830:134:3::10]:54093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTRd-0007v0-ES for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiTRX-0008N3-5b for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTRW-0008Mg-UO for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:19 -0400 From: Luiz Capitulino Date: Thu, 8 May 2014 14:52:32 -0400 Message-Id: <1399575182-9768-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1399575182-9768-1-git-send-email-lcapitulino@redhat.com> References: <1399575182-9768-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 08/38] pci-assign: accept Error from monitor_handle_fd_param2() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws From: Laszlo Ersek 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 eviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index a825871..bfce97f 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 { -- 1.9.0