qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions


From: Michael S. Tsirkin
Subject: Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions
Date: Tue, 11 Jul 2023 04:47:17 -0400

On Tue, Jul 11, 2023 at 10:32:31AM +0200, David Hildenbrand wrote:
> On 10.07.23 23:40, Michael S. Tsirkin wrote:
> > > @@ -2855,12 +2796,11 @@ static void 
> > > virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
> > >                                        SYS_BUS_DEVICE(dev));
> > >           }
> > >       }
> > > +
> > >       if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
> > >           virt_memory_plug(hotplug_dev, dev, errp);
> > > -    }
> > > -
> > > -    if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MEM_PCI)) {
> > > -        virt_virtio_md_pci_plug(hotplug_dev, dev, errp);
> > > +    } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_PCI)) {
> > > +        virtio_md_pci_plug(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev), 
> > > errp);
> > >       }
> > >       if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
> > 
> > 
> > How is this supposed to link if virtio-md is disabled at compile time?
> > 
> 
> Good point.
> 
> The old code unconditionally enabled MEM_DEVICE, so we never required subs
> for that.
> 
> We either need stubs or have to wrap this in #ifdef.
> 
> Stubs sound cleaner.

That is what we usually do, yes.

-- 
MST




reply via email to

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