From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adIbo-0007AW-EH for qemu-devel@nongnu.org; Tue, 08 Mar 2016 09:27:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adIbk-0005vG-FM for qemu-devel@nongnu.org; Tue, 08 Mar 2016 09:27:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adIbk-0005v2-9j for qemu-devel@nongnu.org; Tue, 08 Mar 2016 09:27:32 -0500 From: Gerd Hoffmann Date: Tue, 8 Mar 2016 15:27:22 +0100 Message-Id: <1457447247-4865-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1457447247-4865-1-git-send-email-kraxel@redhat.com> References: <1457447247-4865-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH v4 3/8] igd: switch TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE to realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kevin.tian@intel.com, Alex Williamson , Stefano Stabellini Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Gerd Hoffmann , "open list:All patches CC here" Signed-off-by: Gerd Hoffmann Reviewed-by: Stefano Stabellini --- hw/pci-host/igd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/pci-host/igd.c b/hw/pci-host/igd.c index 331e9e1..93b86ca 100644 --- a/hw/pci-host/igd.c +++ b/hw/pci-host/igd.c @@ -56,7 +56,7 @@ out: return ret; } -static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev) +static void igd_pt_i440fx_realize(PCIDevice *pci_dev, Error **errp) { uint32_t val = 0; int rc, i, num; @@ -68,12 +68,11 @@ static int igd_pt_i440fx_initfn(struct PCIDevice *pci_dev) len = igd_host_bridge_infos[i].len; rc = host_pci_config_read(pos, len, &val); if (rc) { - return -ENODEV; + error_setg(errp, "failed to read host config"); + return; } pci_default_write_config(pci_dev, pos, val, len); } - - return 0; } static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *data) @@ -81,7 +80,7 @@ static void igd_passthrough_i440fx_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - k->init = igd_pt_i440fx_initfn; + k->realize = igd_pt_i440fx_realize; dc->desc = "IGD Passthrough Host bridge"; } -- 1.8.3.1