From patchwork Tue Jan 5 11:41:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 7954241 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 06ED5BEEE5 for ; Tue, 5 Jan 2016 11:45:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3372C20304 for ; Tue, 5 Jan 2016 11:45:12 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A66020166 for ; Tue, 5 Jan 2016 11:45:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGQ08-0004iG-VL; Tue, 05 Jan 2016 11:42:08 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGQ04-0004fc-PQ for xen-devel@lists.xensource.com; Tue, 05 Jan 2016 11:42:04 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id 68/37-31122-C0CAB865; Tue, 05 Jan 2016 11:42:04 +0000 X-Env-Sender: kraxel@redhat.com X-Msg-Ref: server-8.tower-21.messagelabs.com!1451994120!8464836!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13347 invoked from network); 5 Jan 2016 11:42:01 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-8.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Jan 2016 11:42:01 -0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B681EC109084; Tue, 5 Jan 2016 11:41:59 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u05BfwvT024203; Tue, 5 Jan 2016 06:41:58 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 6D69080CD0; Tue, 5 Jan 2016 12:41:57 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 5 Jan 2016 12:41:31 +0100 Message-Id: <1451994098-6972-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1451994098-6972-1-git-send-email-kraxel@redhat.com> References: <1451994098-6972-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Eduardo Habkost , Stefano Stabellini , Cao jin , vfio-users@redhat.com, Gerd Hoffmann Subject: [Xen-devel] [PATCH v3 04/11] igd: switch TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE to realize X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 ef0273b..d1eeafb 100644 --- a/hw/pci-host/igd.c +++ b/hw/pci-host/igd.c @@ -53,7 +53,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; @@ -65,12 +65,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) @@ -78,7 +77,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"; }