From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Brook Subject: Re: [Qemu-devel] [RFC] Getting specific device from qdev structs Date: Mon, 21 Jun 2010 15:07:13 +0100 Message-ID: <201006211507.13975.paul@codesourcery.com> References: <20100621134858.GA8275@localhost> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: "Eduard - Gabriel Munteanu" , kvm@vger.kernel.org, joro@8bytes.org To: qemu-devel@nongnu.org Return-path: Received: from mail.codesourcery.com ([38.113.113.100]:49618 "EHLO mail.codesourcery.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757764Ab0FUOHQ (ORCPT ); Mon, 21 Jun 2010 10:07:16 -0400 In-Reply-To: <20100621134858.GA8275@localhost> Sender: kvm-owner@vger.kernel.org List-ID: > So I've been looking for a way to obtain things like a PCIDevice from a > more generic structure (say from hw/qdev.h), If you're having to figure out what kind of a device you have then I think you're already doing something else wrong. I'd expect the bits of code that needs to identify devices to be inherently bus specific. If you've got some sort of on-cpu IOMMU which is asking "did this come from an ISA device, or a PCI device?", then I suspect you've got your abstraction layers wrong. This should already have been handled by the pci/isa to cpu bridge. Paul