qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RfC PATCH 3/5] usb/ehci: seperate out PCIisms


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [RfC PATCH 3/5] usb/ehci: seperate out PCIisms
Date: Thu, 01 Nov 2012 09:39:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.8) Gecko/20121012 Thunderbird/10.0.8

  Hi,

>> -static int usb_ehci_initfn(PCIDevice *dev)
>> +static void usb_ehci_initfn(EHCIState *s, DeviceState *dev)
>>  {
>> -    EHCIState *s = DO_UPCAST(EHCIState, dev, dev);

>> +static int usb_ehci_pci_initfn(PCIDevice *dev)
>> +{
>> +    EHCIPCIState *i = DO_UPCAST(EHCIPCIState, pcidev, dev);
> 
> Same as discussed for Peter's patchset, this should be using a QOM cast
> macro and may need an abstract base type if there is no unique type
> matching EHCIPCIState struct.

--verbose please.

This is exactly like it used to be.  PCIDeviceClass->init() gets passed
in a PCIDevice pointer and uses DO_UPCAST to get the container struct
carrying the ehci state (EHCIState before the patch, EHCIPCIState now).
 This is common practice all over the tree.

> Should I send you a follow-up to squash if this is the approach we are
> going to take?

If there is a new, more QOM-ish way to do the same feel free to send
patches.  I see that as independent cleanup though, not as something
which should be squashed into this patch.

cheers,
  Gerd




reply via email to

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