[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 08/25] x86-iommu: introduce parent class

From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH v7 08/25] x86-iommu: introduce parent class
Date: Tue, 24 May 2016 00:48:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 05/23/2016 08:06 PM, David Kiarie wrote:
On Tue, May 17, 2016 at 10:15 AM, Peter Xu <address@hidden> wrote:
Introducing parent class for intel-iommu devices named "x86-iommu". This
is preparation work to abstract shared functionalities out from Intel
and AMD IOMMUs. Currently, only the parent class is introduced. It does
nothing yet.

Signed-off-by: Peter Xu <address@hidden>
  hw/i386/Makefile.objs         |  2 +-


+static const TypeInfo x86_iommu_info = {
+    .name          = TYPE_X86_IOMMU_DEVICE,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(X86IOMMUState),
+    .class_init    = x86_iommu_class_init,
+    .class_size    = sizeof(X86IOMMUClass),
+    .abstract      = true,

As I suspected am having some trouble parenting a PCI device from a
Bus device but I will investigate further to see if I can manage

You cannot derive from both SYS_BUS_DEVICE and PCI_DEVICE.
You would need a composition; your device would be a SYS_BUS_DEVICE
and its state would include a PCI_DEVICE (or the other way around).
Then you can divide the responsibilities between them.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]