qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org, Eduardo Habkost <eduardo@habkost.net>
Cc: qemu-block@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Li Qiang" <liq3ea@163.com>,
	qemu-s390x@nongnu.org, "Hu Tao" <hutao@cn.fujitsu.com>,
	"Gonglei Arei" <arei.gonglei@huawei.com>,
	"Cao jin" <caoj.fnst@cn.fujitsu.com>,
	"xiaoqiang zhao" <zxq_yx_007@163.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v2 03/19] hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract parent
Date: Mon, 13 Feb 2023 08:51:32 +0100	[thread overview]
Message-ID: <2c09261e-01e1-38c0-6556-0c42580425be@linaro.org> (raw)
In-Reply-To: <20230213070820.76881-4-philmd@linaro.org>

On 13/2/23 08:08, Philippe Mathieu-Daudé wrote:
> Introduce PCI_MULTISERIAL ("pci-serial"), QOM abstract parent of
> "pci-serial-2x" and "pci-serial-4x".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/char/serial-pci-multi.c | 35 ++++++++++++++++++++---------------
>   1 file changed, 20 insertions(+), 15 deletions(-)
> 
> diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c
> index 54768d3d53..faeb0a9476 100644
> --- a/hw/char/serial-pci-multi.c
> +++ b/hw/char/serial-pci-multi.c
> @@ -38,8 +38,15 @@
>   
>   #define PCI_SERIAL_MAX_PORTS 4
>   
> -typedef struct PCIMultiSerialState {
> +#define TYPE_PCI_MULTISERIAL  "pci-serial"

Ouch, copy/paste mistake, this should be "pci-serial-multi".

> +
> +OBJECT_DECLARE_SIMPLE_TYPE(PCIMultiSerialState, PCI_MULTISERIAL)
> +
> +struct PCIMultiSerialState {
> +    /*< private >*/
>       PCIDevice    dev;
> +    /*< public >*/
> +
>       MemoryRegion iobar;
>       uint32_t     ports;
>       char         *name[PCI_SERIAL_MAX_PORTS];
> @@ -47,7 +54,7 @@ typedef struct PCIMultiSerialState {
>       uint32_t     level[PCI_SERIAL_MAX_PORTS];
>       qemu_irq     *irqs;
>       uint8_t      prog_if;
> -} PCIMultiSerialState;
> +};
>   
>   static void multi_serial_pci_exit(PCIDevice *dev)
>   {
> @@ -191,25 +198,23 @@ static void multi_serial_init(Object *o)
>   
>   static const TypeInfo multi_serial_pci_types[] = {
>       {
> -        .name          = "pci-serial-2x",
> -        .parent        = TYPE_PCI_DEVICE,
> -        .instance_size = sizeof(PCIMultiSerialState),
> -        .instance_init = multi_serial_init,
> -        .class_init    = multi_2x_serial_pci_class_initfn,
> -        .interfaces = (InterfaceInfo[]) {
> +        .name           = TYPE_PCI_MULTISERIAL,
> +        .parent         = TYPE_PCI_DEVICE,
> +        .instance_size  = sizeof(PCIMultiSerialState),
> +        .instance_init  = multi_serial_init,
> +        .abstract       = true,
> +        .interfaces     = (InterfaceInfo[]) {
>               { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>               { },
>           },
> +    }, {
> +        .name          = "pci-serial-2x",
> +        .parent        = TYPE_PCI_MULTISERIAL,
> +        .class_init    = multi_2x_serial_pci_class_initfn,
>       }, {
>           .name          = "pci-serial-4x",
> -        .parent        = TYPE_PCI_DEVICE,
> -        .instance_size = sizeof(PCIMultiSerialState),
> -        .instance_init = multi_serial_init,
> +        .parent        = TYPE_PCI_MULTISERIAL,
>           .class_init    = multi_4x_serial_pci_class_initfn,
> -        .interfaces = (InterfaceInfo[]) {
> -            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> -            { },
> -        },
>       }
>   };
>   



  reply	other threads:[~2023-02-13  7:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  7:08 [PATCH v2 00/19] hw: Use QOM macros and remove DO_UPCAST() uses Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 01/19] hw/char/serial-pci: Replace DO_UPCAST(PCISerialState) by PCI_SERIAL() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 02/19] hw/char/serial-pci-multi: Batch register types using DEFINE_TYPES macro Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 03/19] hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract parent Philippe Mathieu-Daudé
2023-02-13  7:51   ` Philippe Mathieu-Daudé [this message]
2023-02-13  7:08 ` [PATCH v2 04/19] hw/char/serial-pci-multi: Factor multi_serial_class_initfn() out Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 05/19] hw/char/serial-pci-multi: Replace DO_UPCAST() by PCI_MULTISERIAL() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 06/19] hw/ide/qdev: Replace DO_UPCAST(IDEDevice) by IDE_DEVICE() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 07/19] hw/ide/qdev: Replace DO_UPCAST(IDEBus) by IDE_BUS() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 08/19] hw/net/eepro100: Introduce TYPE_EEPRO100 QOM abstract parent Philippe Mathieu-Daudé
2023-02-13  8:36   ` Philippe Mathieu-Daudé
2023-02-13 10:12     ` Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 09/19] hw/net/eepro100: Replace DO_UPCAST(EEPRO100State) by EEPRO100() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 10/19] hw/net/ne2000-pci: Replace DO_UPCAST(PCINE2000State) by PCI_NE2000() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 11/19] hw/net/tulip: Finish QOM conversion Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 12/19] hw/pci/pci: Replace DO_UPCAST(PCIBus) by PCI_BUS() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 13/19] hw/scsi/scsi-bus: Replace DO_UPCAST(SCSIBus) by SCSI_BUS() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 14/19] hw/scsi/scsi-bus: Inline two uses of scsi_bus_from_device() Philippe Mathieu-Daudé
2023-02-13 15:28   ` Eric Farman
2023-02-13  7:08 ` [PATCH v2 15/19] hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT() Philippe Mathieu-Daudé
2023-02-13 15:28   ` Eric Farman
2023-02-13  7:08 ` [PATCH v2 16/19] hw/vfio/ccw: Replace DO_UPCAST(VFIOCCWDevice) by VFIO_CCW() Philippe Mathieu-Daudé
2023-02-13 15:29   ` Eric Farman
2023-02-13 15:51     ` Philippe Mathieu-Daudé
2023-02-13 16:10       ` Philippe Mathieu-Daudé
2023-02-13 16:24         ` Eric Farman
2023-02-13 17:03           ` Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 17/19] hw/usb/dev-hub: Use QOM USB_HUB() macro instead of casting Philippe Mathieu-Daudé
2023-02-13  7:08 ` [PATCH v2 18/19] hw/usb: Replace DO_UPCAST(USBBus) by USB_BUS() Philippe Mathieu-Daudé
2023-02-13  7:08 ` [RFC PATCH v2 19/19] hw/usb: Inline usb_bus_from_device() Philippe Mathieu-Daudé
2023-02-13  8:11   ` Thomas Huth
2023-02-13  8:44     ` Philippe Mathieu-Daudé
2023-02-13  9:11       ` Thomas Huth
2023-02-13  9:49         ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c09261e-01e1-38c0-6556-0c42580425be@linaro.org \
    --to=philmd@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=eduardo@habkost.net \
    --cc=hutao@cn.fujitsu.com \
    --cc=liq3ea@163.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=zxq_yx_007@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).