[PATCH v3 00/14] hw: Use QOM macros and remove DO_UPCAST() uses

Philippe Mathieu-Daudé posted 14 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230213184338.46712-1-philmd@linaro.org
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, John Snow <jsnow@redhat.com>, Jason Wang <jasowang@redhat.com>, Sven Schnelle <svens@stackframe.org>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Fam Zheng <fam@euphon.net>, Gerd Hoffmann <kraxel@redhat.com>
hw/char/serial-pci-multi.c | 93 +++++++++++++++++++-------------------
hw/char/serial-pci.c       |  7 ++-
hw/ide/qdev.c              | 10 ++--
hw/net/ne2000-pci.c        | 18 +++++---
hw/net/tulip.c             | 20 ++++----
hw/pci/pci.c               |  2 +-
hw/s390x/ipl.c             |  7 +--
hw/scsi/scsi-bus.c         | 14 +++---
hw/usb/dev-hub.c           |  6 +--
include/hw/scsi/scsi.h     |  5 --
include/hw/usb.h           |  2 +-
11 files changed, 94 insertions(+), 90 deletions(-)
[PATCH v3 00/14] hw: Use QOM macros and remove DO_UPCAST() uses
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
v3:
- Corrected TYPE_PCI_MULTISERIAL string
- Split EEPRO100 series out:
  https://lore.kernel.org/qemu-devel/20230213101048.94519-1-philmd@linaro.org/
- Split VFIO_CCW series out:
  https://lore.kernel.org/qemu-devel/20230213170145.45666-1-philmd@linaro.org/
- Removed "Inline usb_bus_from_device()" RFC patch
v2:
- Rebased

QOM housekeeping series which replace the DO_UPCAST() macro
uses by equivalent QOM ones. Also:
- Use DEVICE() macro
- Define some TYPE_xxx
- Define some type arrays using DEFINE_TYPES() macro
- Introduce abstract QOM (QDev) parent when relevant.

Based-on: <20230213070423.76428-1-philmd@linaro.org>
          hw/qdev: Housekeeping around qdev_get_parent_bus()

Philippe Mathieu-Daudé (14):
  hw/char/serial-pci: Replace DO_UPCAST(PCISerialState) by PCI_SERIAL()
  hw/char/serial-pci-multi: Batch register types using DEFINE_TYPES
    macro
  hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract
    parent
  hw/char/serial-pci-multi: Factor multi_serial_class_initfn() out
  hw/char/serial-pci-multi: Replace DO_UPCAST() by PCI_MULTISERIAL()
  hw/ide/qdev: Replace DO_UPCAST(IDEDevice) by IDE_DEVICE()
  hw/ide/qdev: Replace DO_UPCAST(IDEBus) by IDE_BUS()
  hw/net/ne2000-pci: Replace DO_UPCAST(PCINE2000State) by PCI_NE2000()
  hw/net/tulip: Finish QOM conversion
  hw/pci/pci: Replace DO_UPCAST(PCIBus) by PCI_BUS()
  hw/scsi/scsi-bus: Replace DO_UPCAST(SCSIBus) by SCSI_BUS()
  hw/scsi/scsi-bus: Inline two uses of scsi_bus_from_device()
  hw/usb/dev-hub: Use QOM USB_HUB() macro instead of casting
  hw/usb: Replace DO_UPCAST(USBBus) by USB_BUS()

 hw/char/serial-pci-multi.c | 93 +++++++++++++++++++-------------------
 hw/char/serial-pci.c       |  7 ++-
 hw/ide/qdev.c              | 10 ++--
 hw/net/ne2000-pci.c        | 18 +++++---
 hw/net/tulip.c             | 20 ++++----
 hw/pci/pci.c               |  2 +-
 hw/s390x/ipl.c             |  7 +--
 hw/scsi/scsi-bus.c         | 14 +++---
 hw/usb/dev-hub.c           |  6 +--
 include/hw/scsi/scsi.h     |  5 --
 include/hw/usb.h           |  2 +-
 11 files changed, 94 insertions(+), 90 deletions(-)

-- 
2.38.1


Re: [PATCH v3 00/14] hw: Use QOM macros and remove DO_UPCAST() uses
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
On 13/2/23 19:43, Philippe Mathieu-Daudé wrote:

> QOM housekeeping series which replace the DO_UPCAST() macro
> uses by equivalent QOM ones. Also:
> - Use DEVICE() macro
> - Define some TYPE_xxx
> - Define some type arrays using DEFINE_TYPES() macro
> - Introduce abstract QOM (QDev) parent when relevant.

> Philippe Mathieu-Daudé (14):
>    hw/char/serial-pci: Replace DO_UPCAST(PCISerialState) by PCI_SERIAL()
>    hw/char/serial-pci-multi: Batch register types using DEFINE_TYPES
>      macro
>    hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract
>      parent
>    hw/char/serial-pci-multi: Factor multi_serial_class_initfn() out
>    hw/char/serial-pci-multi: Replace DO_UPCAST() by PCI_MULTISERIAL()

>    hw/ide/qdev: Replace DO_UPCAST(IDEDevice) by IDE_DEVICE()
>    hw/ide/qdev: Replace DO_UPCAST(IDEBus) by IDE_BUS()

>    hw/net/ne2000-pci: Replace DO_UPCAST(PCINE2000State) by PCI_NE2000()
>    hw/net/tulip: Finish QOM conversion

>    hw/pci/pci: Replace DO_UPCAST(PCIBus) by PCI_BUS()

>    hw/scsi/scsi-bus: Replace DO_UPCAST(SCSIBus) by SCSI_BUS()
>    hw/scsi/scsi-bus: Inline two uses of scsi_bus_from_device()

>    hw/usb/dev-hub: Use QOM USB_HUB() macro instead of casting
>    hw/usb: Replace DO_UPCAST(USBBus) by USB_BUS()

I'll respin as tiny series to help maintainers catch which patches
belong to their areas.

Re: [PATCH v3 00/14] hw: Use QOM macros and remove DO_UPCAST() uses
Posted by Philippe Mathieu-Daudé 1 year, 2 months ago
(meanwhile, forgot to Cc Alex)

On 28/2/23 14:43, Philippe Mathieu-Daudé wrote:
> On 13/2/23 19:43, Philippe Mathieu-Daudé wrote:
> 
>> QOM housekeeping series which replace the DO_UPCAST() macro
>> uses by equivalent QOM ones. Also:
>> - Use DEVICE() macro
>> - Define some TYPE_xxx
>> - Define some type arrays using DEFINE_TYPES() macro
>> - Introduce abstract QOM (QDev) parent when relevant.
> 
>> Philippe Mathieu-Daudé (14):
>>    hw/char/serial-pci: Replace DO_UPCAST(PCISerialState) by PCI_SERIAL()
>>    hw/char/serial-pci-multi: Batch register types using DEFINE_TYPES
>>      macro
>>    hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract
>>      parent
>>    hw/char/serial-pci-multi: Factor multi_serial_class_initfn() out
>>    hw/char/serial-pci-multi: Replace DO_UPCAST() by PCI_MULTISERIAL()
> 
>>    hw/ide/qdev: Replace DO_UPCAST(IDEDevice) by IDE_DEVICE()
>>    hw/ide/qdev: Replace DO_UPCAST(IDEBus) by IDE_BUS()
> 
>>    hw/net/ne2000-pci: Replace DO_UPCAST(PCINE2000State) by PCI_NE2000()
>>    hw/net/tulip: Finish QOM conversion
> 
>>    hw/pci/pci: Replace DO_UPCAST(PCIBus) by PCI_BUS()
> 
>>    hw/scsi/scsi-bus: Replace DO_UPCAST(SCSIBus) by SCSI_BUS()
>>    hw/scsi/scsi-bus: Inline two uses of scsi_bus_from_device()
> 
>>    hw/usb/dev-hub: Use QOM USB_HUB() macro instead of casting
>>    hw/usb: Replace DO_UPCAST(USBBus) by USB_BUS()
> 
> I'll respin as tiny series to help maintainers catch which patches
> belong to their areas.