From patchwork Tue Dec 20 16:51:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 132450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 59817B704B for ; Wed, 21 Dec 2011 03:52:40 +1100 (EST) Received: from localhost ([::1]:35320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2vd-0005p4-Ik for incoming@patchwork.ozlabs.org; Tue, 20 Dec 2011 11:52:37 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2vH-0005Gc-Qg for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:52:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd2vG-0006UA-Gb for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:52:15 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:41613 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2vG-0006U4-AK for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:52:14 -0500 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pBKGqBqF021554; Tue, 20 Dec 2011 10:52:11 -0600 Received: (from anthony@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id pBKGqACZ021552; Tue, 20 Dec 2011 10:52:10 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Tue, 20 Dec 2011 10:51:35 -0600 Message-Id: <1324399916-21315-7-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> References: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 70.123.132.139 Cc: Paolo Bonzini , Anthony Liguori , Markus Armbruster Subject: [Qemu-devel] [PATCH 06/27] pci: check for an initialized QOM object instead of looking for an info link X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We want to eliminate DeviceInfo so update the PCI check to look for a valid class pointer. Signed-off-by: Anthony Liguori --- hw/pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 4fc46c2..3ea6223 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -161,8 +161,8 @@ void pci_device_reset(PCIDevice *dev) int r; /* TODO: call the below unconditionally once all pci devices * are qdevified */ - if (qdev_get_info(&dev->qdev)) { - qdev_reset_all(&dev->qdev); + if (OBJECT(dev)->class != NULL) { + qdev_reset_all(DEVICE(dev)); } dev->irq_state = 0;