[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: |
David Hildenbrand |
Subject: |
Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions |
Date: |
Tue, 11 Jul 2023 11:22:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 |
On 11.07.23 10:47, Michael S. Tsirkin wrote:
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.
I'm testing with the following:
diff --git a/stubs/meson.build b/stubs/meson.build
index a56645e2f7..160154912c 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -65,3 +65,4 @@ else
endif
stub_ss.add(files('semihost-all.c'))
stub_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_false:
files('vfio-user-obj.c'))
+stub_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio_md_pci.c'))
diff --git a/stubs/virtio_md_pci.c b/stubs/virtio_md_pci.c
new file mode 100644
index 0000000000..ce5bba0c9d
--- /dev/null
+++ b/stubs/virtio_md_pci.c
@@ -0,0 +1,24 @@
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "hw/virtio/virtio-md-pci.h"
+
+void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+ error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+ error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,
+ Error **errp)
+{
+ error_setg(errp, "virtio based memory devices not supported");
+}
+
+void virtio_md_pci_unplug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)
+{
+ error_setg(errp, "virtio based memory devices not supported");
+}
For now (not having virtio-md-ccw or virtio-md-mmio) this should do the trick I
think.
--
Cheers,
David / dhildenb
[PATCH v3 4/7] virtio-md-pci: Handle unplug of virtio based memory devices, David Hildenbrand, 2023/07/10
[PATCH v3 5/7] virtio-md-pci: Support unplug requests for compatible devices, David Hildenbrand, 2023/07/10
[PATCH v3 6/7] virtio-mem: Prepare for device unplug support, David Hildenbrand, 2023/07/10
[PATCH v3 7/7] virtio-mem-pci: Device unplug support, David Hildenbrand, 2023/07/10
Re: [PATCH v3 0/7] virtio-mem: Device unplug support, Mario Casquero, 2023/07/11