qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 03/42] esp: QOMify the internal ESP device state


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 03/42] esp: QOMify the internal ESP device state
Date: Fri, 12 Feb 2021 19:51:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 2/9/21 8:29 PM, Mark Cave-Ayland wrote:
> Make this new QOM device state a child device of both the sysbus-esp and 
> esp-pci
> implementations.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/scsi/esp-pci.c     | 48 +++++++++++++++++++++++++++++++------------
>  hw/scsi/esp.c         | 45 +++++++++++++++++++++++++++++++++-------
>  include/hw/scsi/esp.h |  5 +++++
>  3 files changed, 78 insertions(+), 20 deletions(-)

Please setup scripts/git.orderfile ;)

...
> @@ -354,9 +365,11 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error 
> **errp)
>  {
>      PCIESPState *pci = PCI_ESP(dev);
>      DeviceState *d = DEVICE(dev);
> -    ESPState *s = &pci->esp;
> +    ESPState *s = ESP(&pci->esp);
>      uint8_t *pci_conf;
>  
> +    qdev_realize(DEVICE(s), NULL, errp);

       if (!qdev_realize(DEVICE(s), NULL, errp)) {
           return;
       }

>      pci_conf = dev->config;
>  
>      /* Interrupt pin A */
> @@ -375,11 +388,19 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error 
> **errp)
>      scsi_bus_new(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info, NULL);
>  }
...

> @@ -956,7 +958,9 @@ static void sysbus_esp_realize(DeviceState *dev, Error 
> **errp)
>  {
>      SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
>      SysBusESPState *sysbus = SYSBUS_ESP(dev);
> -    ESPState *s = &sysbus->esp;
> +    ESPState *s = ESP(&sysbus->esp);
> +
> +    qdev_realize(DEVICE(s), NULL, errp);

       if (!qdev_realize(DEVICE(s), NULL, errp)) {
           return;
       }

With both if():
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



reply via email to

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