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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51098 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQheh-0006QK-8z for qemu-devel@nongnu.org; Mon, 21 Jun 2010 10:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQheg-00027R-5N for qemu-devel@nongnu.org; Mon, 21 Jun 2010 10:07:19 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:45453) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQhef-00027D-Ol for qemu-devel@nongnu.org; Mon, 21 Jun 2010 10:07:18 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [RFC] Getting specific device from qdev structs Date: Mon, 21 Jun 2010 15:07:13 +0100 References: <20100621134858.GA8275@localhost> In-Reply-To: <20100621134858.GA8275@localhost> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006211507.13975.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: joro@8bytes.org, kvm@vger.kernel.org, Eduard - Gabriel Munteanu > 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