hw/hotplug: Constify HotplugHandler
cover hw/hotplug: Constify HotplugHandler
We want to mark QOM interfaces const. HotplugHandler is the interface with most uses, so start the code churn with it...
Philippe Mathieu-Daudé (4):
hw/acpi: Make AcpiGedState const in build_ged_aml() hw/hotplug: Mark various HotplugHandlerClass variables as const hw/hotplug: Reduce some HotplugHandler variables scope hw/hotplug: Constify HotplugHandler
hw/s390x/ccw-device.h | 2 +- include/hw/acpi/cpu.h | 4 +-- include/hw/acpi/cpu_hotplug.h | 2 +- include/hw/acpi/generic_event_device.h | 3 +- include/hw/acpi/ich9.h | 10 +++--- include/hw/acpi/memory_hotplug.h | 4 +-- include/hw/acpi/pcihp.h | 8 ++--- include/hw/core/boards.h | 4 +-- include/hw/core/hotplug.h | 13 +++---- include/hw/core/qdev.h | 14 ++++---- include/hw/i386/microvm.h | 4 +-- include/hw/i386/x86.h | 10 +++--- include/hw/mem/nvdimm.h | 2 +- include/hw/pci/pci_bridge.h | 6 ++-- include/hw/pci/pcie.h | 8 ++--- include/hw/pci/shpc.h | 6 ++-- include/hw/ppc/spapr_nvdimm.h | 2 +- hw/acpi/acpi-cpu-hotplug-stub.c | 4 +-- hw/acpi/acpi-mem-hotplug-stub.c | 4 +-- hw/acpi/acpi-nvdimm-stub.c | 2 +- hw/acpi/acpi-pci-hotplug-stub.c | 8 ++--- hw/acpi/cpu.c | 6 ++-- hw/acpi/generic_event_device.c | 13 +++---- hw/acpi/ich9.c | 10 +++--- hw/acpi/memory_hotplug.c | 7 ++-- hw/acpi/nvdimm.c | 2 +- hw/acpi/pcihp.c | 11 +++--- hw/acpi/piix4.c | 12 +++---- hw/arm/virt.c | 23 ++++++------ hw/char/virtio-serial-bus.c | 2 +- hw/core/hotplug.c | 16 ++++----- hw/core/qdev-hotplug.c | 10 +++--- hw/core/qdev.c | 2 +- hw/i386/microvm.c | 12 +++---- hw/i386/pc.c | 28 +++++++-------- hw/i386/x86-common.c | 8 ++--- hw/intc/loongarch_dintc.c | 8 ++--- hw/intc/loongarch_extioi_common.c | 4 +-- hw/intc/loongarch_ipi.c | 4 +-- hw/loongarch/virt.c | 44 +++++++++++------------ hw/net/virtio-net.c | 4 +-- hw/nvme/ctrl.c | 8 ++--- hw/pci-bridge/pci_bridge_dev.c | 6 ++-- hw/pci/pcie.c | 10 +++--- hw/pci/pcie_port.c | 2 +- hw/pci/shpc.c | 11 +++--- hw/ppc/e500plat.c | 4 +-- hw/ppc/spapr.c | 48 +++++++++++++------------- hw/ppc/spapr_nvdimm.c | 2 +- hw/ppc/spapr_pci.c | 12 +++---- hw/remote/machine.c | 2 +- hw/riscv/virt.c | 6 ++-- hw/s390x/css-bridge.c | 2 +- hw/s390x/s390-pci-bus.c | 12 +++---- hw/s390x/s390-virtio-ccw.c | 16 ++++----- hw/s390x/virtio-ccw-md.c | 10 +++--- hw/s390x/virtio-ccw.c | 2 +- hw/scsi/virtio-scsi.c | 6 ++-- hw/scsi/vmw_pvscsi.c | 4 +-- hw/virtio/virtio-md-pci.c | 10 +++--- hw/xen/xen-bus.c | 2 +- stubs/hotplug-stubs.c | 6 ++-- system/qdev-monitor.c | 4 +-- 63 files changed, 269 insertions(+), 262 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/4 hw/acpi: Make AcpiGedState const in build_ged_aml()
build_ged_aml() do not modify the AcpiGedState structure.
--- hw/acpi/generic_event_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/acpi/generic_event_device.c +1 -1
@@ -48,7 +48,7 @@ static const uint32_t ged_supported_events[] = {void build_ged_aml (Aml *table,const char *name,HotplugHandler *hotplug_dev,uint32_t ged_irq,AmlRegionSpace rs,hwaddr ged_base) { -AcpiGedState *s =ACPI_GED (hotplug_dev); +const AcpiGedState *s =ACPI_GED (hotplug_dev);Aml *crs =aml_resource_template ();Aml *evt, *field;Aml *dev =aml_device ("%s" , name);
Signature · 1 line
2.53.0
PATCH 2/4 hw/hotplug: Mark various HotplugHandlerClass variables as const
In reply to Philippe Mathieu-DaudéThe HotplugHandlerClass pointers are only dereferenced, not updated.
--- include/hw/core/qdev.h | 2 +- hw/core/hotplug.c | 8 ++++---- hw/s390x/virtio-ccw-md.c | 2 +- hw/virtio/virtio-md-pci.c | 2 +- system/qdev-monitor.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-)
include/hw/core/qdev.h +1 -1
@@ -1069,7 +1069,7 @@ static inline bool qbus_is_hotpluggable(BusState *bus)bool ret = !!plug_handler;if (plug_handler) { -HotplugHandlerClass *hdc; +const HotplugHandlerClass *hdc; hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler);if (hdc->is_hotpluggable_bus) {
hw/core/hotplug.c +4 -4
@@ -17,7 +17,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { -HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler); +const HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler);if (hdc->pre_plug) { hdc->pre_plug (plug_handler, plugged_dev, errp);
@@ -28,7 +28,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { -HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler); +const HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler);if (hdc->plug) { hdc->plug (plug_handler, plugged_dev, errp);
@@ -39,7 +39,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { -HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler); +const HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler);if (hdc->unplug_request) { hdc->unplug_request (plug_handler, plugged_dev, errp);
@@ -50,7 +50,7 @@ void hotplug_handler_unplug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { -HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler); +const HotplugHandlerClass *hdc =HOTPLUG_HANDLER_GET_CLASS (plug_handler);if (hdc->unplug) { hdc->unplug (plug_handler, plugged_dev, errp);
hw/s390x/virtio-ccw-md.c +1 -1
@@ -73,7 +73,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, MachineState *ms,VirtIOMDCcwClass *vmdc =VIRTIO_MD_CCW_GET_CLASS (vmd);DeviceState *dev =DEVICE (vmd);HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); -HotplugHandlerClass *hdc; +const HotplugHandlerClass *hdc;Error *local_err =NULL ;if (!vmdc->unplug_request_check) {
hw/virtio/virtio-md-pci.c +1 -1
@@ -72,7 +72,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,VirtIOMDPCIClass *vmdc =VIRTIO_MD_PCI_GET_CLASS (vmd);DeviceState *dev =DEVICE (vmd);HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); -HotplugHandlerClass *hdc; +const HotplugHandlerClass *hdc;Error *local_err =NULL ;if (!vmdc->unplug_request_check) {
system/qdev-monitor.c +1 -1
@@ -918,7 +918,7 @@ static DeviceState *find_device_state(const char *id, bool use_generic_error,void qdev_unplug (DeviceState *dev,Error **errp) {HotplugHandler *hotplug_ctrl; -HotplugHandlerClass *hdc; +const HotplugHandlerClass *hdc;Error *local_err =NULL ;if (!qdev_hotunplug_allowed (dev, errp)) {
Signature · 1 line
2.53.0
PATCH 3/4 hw/hotplug: Reduce some HotplugHandler variables scope
In reply to Philippe Mathieu-Daudé--- hw/acpi/memory_hotplug.c | 3 ++- hw/acpi/pcihp.c | 3 ++- hw/pci/shpc.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
hw/acpi/memory_hotplug.c +2 -1
@@ -119,7 +119,6 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,MemStatus *mdev;ACPIOSTInfo *info;DeviceState *dev =NULL ; -HotplugHandler *hotplug_ctrl =NULL ;Error *local_err =NULL ;if (!mem_st->dev_count) {
@@ -167,6 +166,8 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, mdev->is_removing = false;trace_mhp_acpi_clear_remove_evt (mem_st->selector); }else if (data &8 ) { +HotplugHandler *hotplug_ctrl; +if (!mdev->is_enabled) {trace_mhp_acpi_ejecting_invalid_slot (mem_st->selector);break ;
hw/acpi/pcihp.c +2 -1
@@ -173,7 +173,6 @@ static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s, PCIDevice *dev)static void acpi_pcihp_eject_slot (AcpiPciHpState *s,unsigned bsel,unsigned slots) { -HotplugHandler *hotplug_ctrl;BusChild *kid, *next;int slot =ctz32 (slots);PCIBus *bus =acpi_pcihp_find_hotplug_bus (s, bsel);
@@ -210,6 +209,8 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, unsigned bsel, unsigned slo*/ qdev->pending_deleted_event = false; }else { +HotplugHandler *hotplug_ctrl; + hotplug_ctrl =qdev_get_hotplug_handler (qdev);hotplug_handler_unplug (hotplug_ctrl, qdev, &error_abort);object_unparent (OBJECT (qdev));
hw/pci/shpc.c +2 -1
@@ -271,7 +271,6 @@ static void shpc_invalid_command(SHPCDevice *shpc)static void shpc_free_devices_in_slot (SHPCDevice *shpc,int slot) { -HotplugHandler *hotplug_ctrl;int devfn;int pci_slot =SHPC_IDX_TO_PCI (slot); for (devfn = PCI_DEVFN(pci_slot, 0);
@@ -279,6 +278,8 @@ static void shpc_free_devices_in_slot(SHPCDevice *shpc, int slot) ++devfn) {PCIDevice *affected_dev = shpc->sec_bus->devices[devfn];if (affected_dev) { +HotplugHandler *hotplug_ctrl; + hotplug_ctrl =qdev_get_hotplug_handler (DEVICE (affected_dev));hotplug_handler_unplug (hotplug_ctrl,DEVICE (affected_dev), &error_abort);
Signature · 1 line
2.53.0
PATCH 4/4 hw/hotplug: Constify HotplugHandler
In reply to Philippe Mathieu-DaudéHotplugHandler value returned from qdev_get_hotplug_handler() points to the handler of and object implementing the TYPE_HOTPLUG_HANDLER interface. That handler mostly points to read-only section which shouldn't not be updated. Better protect it with the const qualifier.
Mechanical change using 'sed' then manually adapted coding style.
--- hw/s390x/ccw-device.h | 2 +- include/hw/acpi/cpu.h | 4 +-- include/hw/acpi/cpu_hotplug.h | 2 +- include/hw/acpi/generic_event_device.h | 3 +- include/hw/acpi/ich9.h | 10 +++--- include/hw/acpi/memory_hotplug.h | 4 +-- include/hw/acpi/pcihp.h | 8 ++--- include/hw/core/boards.h | 4 +-- include/hw/core/hotplug.h | 13 +++---- include/hw/core/qdev.h | 12 +++---- include/hw/i386/microvm.h | 4 +-- include/hw/i386/x86.h | 10 +++--- include/hw/mem/nvdimm.h | 2 +- include/hw/pci/pci_bridge.h | 6 ++-- include/hw/pci/pcie.h | 8 ++--- include/hw/pci/shpc.h | 6 ++-- include/hw/ppc/spapr_nvdimm.h | 2 +- hw/acpi/acpi-cpu-hotplug-stub.c | 4 +-- hw/acpi/acpi-mem-hotplug-stub.c | 4 +-- hw/acpi/acpi-nvdimm-stub.c | 2 +- hw/acpi/acpi-pci-hotplug-stub.c | 8 ++--- hw/acpi/cpu.c | 6 ++-- hw/acpi/generic_event_device.c | 11 +++--- hw/acpi/ich9.c | 10 +++--- hw/acpi/memory_hotplug.c | 6 ++-- hw/acpi/nvdimm.c | 2 +- hw/acpi/pcihp.c | 10 +++--- hw/acpi/piix4.c | 12 +++---- hw/arm/virt.c | 23 ++++++------ hw/char/virtio-serial-bus.c | 2 +- hw/core/hotplug.c | 8 ++--- hw/core/qdev-hotplug.c | 10 +++--- hw/core/qdev.c | 2 +- hw/i386/microvm.c | 12 +++---- hw/i386/pc.c | 28 +++++++-------- hw/i386/x86-common.c | 8 ++--- hw/intc/loongarch_dintc.c | 8 ++--- hw/intc/loongarch_extioi_common.c | 4 +-- hw/intc/loongarch_ipi.c | 4 +-- hw/loongarch/virt.c | 44 +++++++++++------------ hw/net/virtio-net.c | 4 +-- hw/nvme/ctrl.c | 8 ++--- hw/pci-bridge/pci_bridge_dev.c | 6 ++-- hw/pci/pcie.c | 10 +++--- hw/pci/pcie_port.c | 2 +- hw/pci/shpc.c | 10 +++--- hw/ppc/e500plat.c | 4 +-- hw/ppc/spapr.c | 48 +++++++++++++------------- hw/ppc/spapr_nvdimm.c | 2 +- hw/ppc/spapr_pci.c | 12 +++---- hw/remote/machine.c | 2 +- hw/riscv/virt.c | 6 ++-- hw/s390x/css-bridge.c | 2 +- hw/s390x/s390-pci-bus.c | 12 +++---- hw/s390x/s390-virtio-ccw.c | 16 ++++----- hw/s390x/virtio-ccw-md.c | 8 ++--- hw/s390x/virtio-ccw.c | 2 +- hw/scsi/virtio-scsi.c | 6 ++-- hw/scsi/vmw_pvscsi.c | 4 +-- hw/virtio/virtio-md-pci.c | 8 ++--- hw/xen/xen-bus.c | 2 +- stubs/hotplug-stubs.c | 6 ++-- system/qdev-monitor.c | 2 +- 63 files changed, 257 insertions(+), 253 deletions(-)
hw/s390x/ccw-device.h +1 -1
@@ -37,7 +37,7 @@ extern const VMStateDescription vmstate_ccw_dev;struct CCWDeviceClass {DeviceClass parent_class; -void (*unplug)(HotplugHandler *,DeviceState *,Error **); +void (*unplug)(const HotplugHandler *,DeviceState *,Error **);bool (*realize)(CcwDevice *,Error **);void (*refill_ids)(CcwDevice *); };
include/hw/acpi/cpu.h +2 -2
@@ -39,10 +39,10 @@ typedef struct CPUHotplugState {AcpiCpuStatus *devs; } CPUHotplugState; -void acpi_cpu_plug_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp); -void acpi_cpu_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp);
include/hw/acpi/cpu_hotplug.h +1 -1
@@ -25,7 +25,7 @@ typedef struct AcpiCpuHotplug {uint8_t sts[ACPI_GPE_PROC_LEN ]; } AcpiCpuHotplug; -void legacy_acpi_cpu_plug_cb (HotplugHandler *hotplug_dev, +void legacy_acpi_cpu_plug_cb (const HotplugHandler *hotplug_dev,AcpiCpuHotplug *g,DeviceState *dev,Error **errp); void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
include/hw/acpi/generic_event_device.h +2 -1
@@ -136,7 +136,8 @@ typedef struct AcpiGedClass {ResettablePhases parent_phases; } AcpiGedClass; -void build_ged_aml (Aml *table,const char * name,HotplugHandler *hotplug_dev, +void build_ged_aml (Aml *table,const char *name, +const HotplugHandler *hotplug_dev,uint32_t ged_irq,AmlRegionSpace rs,hwaddr ged_base);void acpi_dsdt_add_power_button (Aml *scope);
include/hw/acpi/ich9.h +5 -5
@@ -85,15 +85,15 @@ void ich9_pm_reset_properties(ICH9LPCPMRegs *pm);void ich9_pm_add_class_properties (ObjectClass *oc,ptrdiff_t pm_offset); -void ich9_pm_device_pre_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void ich9_pm_device_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void ich9_pm_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void ich9_pm_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void ich9_pm_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -bool ich9_pm_is_hotpluggable_bus (HotplugHandler *hotplug_dev,BusState *bus); +bool ich9_pm_is_hotpluggable_bus (const HotplugHandler *hotplug_dev,BusState *bus);void ich9_pm_ospm_status (AcpiDeviceIf *adev,ACPIOSTInfoList ***list);#endif /* HW_ACPI_ICH9_H */
include/hw/acpi/memory_hotplug.h +2 -2
@@ -36,9 +36,9 @@ typedef struct MemHotplugState {void acpi_memory_hotplug_init (MemoryRegion *as,Object *owner,MemHotplugState *state,hwaddr io_base); -void acpi_memory_plug_cb (HotplugHandler *hotplug_dev,MemHotplugState *mem_st, +void acpi_memory_plug_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp); -void acpi_memory_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp); void acpi_memory_unplug_cb(MemHotplugState *mem_st,
include/hw/acpi/pcihp.h +4 -4
@@ -66,13 +66,13 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *, MemoryRegion *io, uint16_t io_base);bool acpi_pcihp_is_hotpluggable_bus (AcpiPciHpState *s,BusState *bus); -void acpi_pcihp_device_pre_plug_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void acpi_pcihp_device_plug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_plug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp); -void acpi_pcihp_device_unplug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_unplug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp); -void acpi_pcihp_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp);
include/hw/core/boards.h +2 -2
@@ -322,8 +322,8 @@ struct MachineClass {SMPCompatProps smp_props;const char *default_ram_id; - HotplugHandler *(*get_hotplug_handler)(MachineState *machine, - DeviceState *dev); +const HotplugHandler *(*get_hotplug_handler)(MachineState *machine, +DeviceState *dev);bool (*hotplug_allowed)(MachineState *state,DeviceState *dev,Error **errp); CpuInstanceProperties (*cpu_index_to_instance_props)(MachineState *machine,
include/hw/core/hotplug.h +7 -6
@@ -30,7 +30,7 @@ typedef struct HotplugHandler HotplugHandler;* @plugged_dev: a device that has been (un)plugged * @errp: returns an error if this function fails */ -typedef void (*hotplug_fn )(HotplugHandler *plug_handler, +typedef void (*hotplug_fn )(const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp);/**
@@ -59,7 +59,8 @@ struct HotplugHandlerClass {hotplug_fn plug;hotplug_fn unplug_request;hotplug_fn unplug; -bool (*is_hotpluggable_bus)(HotplugHandler *plug_handler,BusState *bus); +bool (*is_hotpluggable_bus)(const HotplugHandler *plug_handler, +BusState *bus); };/**
@@ -67,7 +68,7 @@ struct HotplugHandlerClass {* * Call #HotplugHandlerClass.plug callback of @plug_handler. */ -void hotplug_handler_plug (HotplugHandler *plug_handler, +void hotplug_handler_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp);
@@ -76,7 +77,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler,* * Call #HotplugHandlerClass.pre_plug callback of @plug_handler. */ -void hotplug_handler_pre_plug (HotplugHandler *plug_handler, +void hotplug_handler_pre_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp);
@@ -85,7 +86,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handler,* * Calls #HotplugHandlerClass.unplug_request callback of @plug_handler. */ -void hotplug_handler_unplug_request (HotplugHandler *plug_handler, +void hotplug_handler_unplug_request (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp);/**
@@ -93,7 +94,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_handler,* * Calls #HotplugHandlerClass.unplug callback of @plug_handler. */ -void hotplug_handler_unplug (HotplugHandler *plug_handler, +void hotplug_handler_unplug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp);#endif
include/hw/core/qdev.h +6 -6
@@ -386,7 +386,7 @@ struct BusState {/* public: */ DeviceState *parent;char *name; -HotplugHandler *hotplug_handler; +const HotplugHandler *hotplug_handler;int max_index;bool realized;bool full;
@@ -514,8 +514,8 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);void qdev_unrealize (DeviceState *dev);void qdev_set_legacy_instance_id (DeviceState *dev,int alias_id,int required_for_version); -HotplugHandler *qdev_get_bus_hotplug_handler (DeviceState *dev); -HotplugHandler *qdev_get_machine_hotplug_handler (DeviceState *dev); +const HotplugHandler *qdev_get_bus_hotplug_handler (DeviceState *dev); +const HotplugHandler *qdev_get_machine_hotplug_handler (DeviceState *dev);bool qdev_hotplug_allowed (DeviceState *dev,BusState *bus,Error **errp);bool qdev_hotunplug_allowed (DeviceState *dev,Error **errp);
@@ -529,10 +529,10 @@ bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp);* Return: pointer to object that implements TYPE_HOTPLUG_HANDLER interface * or NULL if there aren't any. */ -HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev); +const HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev);void qdev_unplug (DeviceState *dev,Error **errp);int qdev_sync_config (DeviceState *dev,Error **errp); -void qdev_simple_device_unplug_cb (HotplugHandler *hotplug_dev, +void qdev_simple_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp);void qdev_machine_creation_done (void );bool qdev_machine_modified (void );
@@ -1065,7 +1065,7 @@ void qbus_set_bus_hotplug_handler(BusState *bus);static inline bool qbus_is_hotpluggable (BusState *bus) { -HotplugHandler *plug_handler = bus->hotplug_handler; +const HotplugHandler *plug_handler = bus->hotplug_handler;bool ret = !!plug_handler;if (plug_handler) {
include/hw/i386/microvm.h +2 -2
@@ -76,8 +76,8 @@struct MicrovmMachineClass {X86MachineClass parent; -HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, -DeviceState *dev); +const HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, +DeviceState *dev);void (*x86_load_linux)(X86MachineState *x86ms,FWCfgState *fw_cfg,int acpi_data_size); };
include/hw/i386/x86.h +5 -5
@@ -46,7 +46,7 @@ struct X86MachineState {qemu_irq *gsi;DeviceState *ioapic2;GMappedFile *initrd_mapped_file; -HotplugHandler *acpi_dev; +const HotplugHandler *acpi_dev;/* * Map the whole BIOS just underneath the 4 GiB address boundary. Only used
@@ -112,13 +112,13 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState *x86ms,void x86_cpus_init (X86MachineState *pcms,int default_cpu_version);void x86_rtc_set_cpus_count (ISADevice *rtc,uint16_t cpus_count); -void x86_cpu_pre_plug (HotplugHandler *hotplug_dev, +void x86_cpu_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void x86_cpu_plug (HotplugHandler *hotplug_dev, +void x86_cpu_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void x86_cpu_unplug_request_cb (HotplugHandler *hotplug_dev, +void x86_cpu_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void x86_cpu_unplug_cb (HotplugHandler *hotplug_dev, +void x86_cpu_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); void x86_isa_bios_init(MemoryRegion *isa_bios, MemoryRegion *isa_memory,
include/hw/mem/nvdimm.h +1 -1
@@ -157,5 +157,5 @@ void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, uint32_t ram_slots, const char *oem_id, const char *oem_table_id);void nvdimm_plug (NVDIMMState *state); -void nvdimm_acpi_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev); +void nvdimm_acpi_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev);#endif
include/hw/pci/pci_bridge.h +3 -3
@@ -141,11 +141,11 @@ void pci_bridge_reset(DeviceState *qdev);void pci_bridge_initfn (PCIDevice *pci_dev,const char *typename);void pci_bridge_exitfn (PCIDevice *pci_dev); -void pci_bridge_dev_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pci_bridge_dev_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void pci_bridge_dev_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pci_bridge_dev_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void pci_bridge_dev_unplug_request_cb (HotplugHandler *hotplug_dev, +void pci_bridge_dev_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp);/*
include/hw/pci/pcie.h +4 -4
@@ -146,13 +146,13 @@ void pcie_ats_init(PCIDevice *dev, uint16_t offset, bool aligned);void pcie_cap_fill_link_ep_usp (PCIDevice *dev,PCIExpLinkWidth width,PCIExpLinkSpeed speed,bool flitmode); -void pcie_cap_slot_pre_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void pcie_cap_slot_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void pcie_cap_slot_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void pcie_cap_slot_unplug_request_cb (HotplugHandler *hotplug_dev, +void pcie_cap_slot_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); void pcie_pasid_common_init(PCIDevice *dev, uint16_t offset,
include/hw/pci/shpc.h +3 -3
@@ -45,11 +45,11 @@ void shpc_free(PCIDevice *dev);void shpc_cap_write_config (PCIDevice *d,uint32_t addr,uint32_t val,int len); -void shpc_device_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void shpc_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void shpc_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void shpc_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp); -void shpc_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void shpc_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp);extern const VMStateInfo shpc_vmstate_info;
include/hw/ppc/spapr_nvdimm.h +1 -1
@@ -18,7 +18,7 @@ typedef struct SpaprMachineState SpaprMachineState;int spapr_pmem_dt_populate (SpaprDrc *drc,SpaprMachineState *spapr,void *fdt,int *fdt_start_offset,Error **errp);void spapr_dt_persistent_memory (SpaprMachineState *spapr,void *fdt); -bool spapr_nvdimm_validate (HotplugHandler *hotplug_dev,NVDIMMDevice *nvdimm, +bool spapr_nvdimm_validate (const HotplugHandler *hotplug_dev,NVDIMMDevice *nvdimm,uint64_t size,Error **errp);void spapr_add_nvdimm (DeviceState *dev,uint64_t slot);void spapr_nvdimm_finish_flushes (void );
hw/acpi/acpi-cpu-hotplug-stub.c +2 -2
@@ -14,7 +14,7 @@ void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list) { } -void acpi_cpu_plug_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp) { }
@@ -24,7 +24,7 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, { } -void acpi_cpu_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp) {
hw/acpi/acpi-mem-hotplug-stub.c +2 -2
@@ -13,7 +13,7 @@ void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list) { } -void acpi_memory_plug_cb (HotplugHandler *hotplug_dev,MemHotplugState *mem_st, +void acpi_memory_plug_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp) { }
@@ -23,7 +23,7 @@ void acpi_memory_unplug_cb(MemHotplugState *mem_st, { } -void acpi_memory_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp) {
hw/acpi/acpi-nvdimm-stub.c +1 -1
@@ -2,6 +2,6 @@#include "hw/mem/nvdimm.h" #include "hw/core/hotplug.h" -void nvdimm_acpi_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev) +void nvdimm_acpi_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev) { }
hw/acpi/acpi-pci-hotplug-stub.c +4 -4
@@ -9,22 +9,22 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, { } -void acpi_pcihp_device_plug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_plug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) { } -void acpi_pcihp_device_pre_plug_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) { } -void acpi_pcihp_device_unplug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_unplug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) { } -void acpi_pcihp_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) {
hw/acpi/cpu.c +3 -3
@@ -132,7 +132,7 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, uint64_t data,trace_cpuhp_acpi_clear_remove_evt (cpu_st->selector); }else if (data &8 ) {DeviceState *dev =NULL ; -HotplugHandler *hotplug_ctrl =NULL ; +const HotplugHandler *hotplug_ctrl;if (!cdev->cpu || cdev->cpu == first_cpu) {trace_cpuhp_acpi_ejecting_invalid_cpu (cpu_st->selector);
@@ -247,7 +247,7 @@ static AcpiCpuStatus *get_cpu_status(CPUHotplugState *cpu_st, DeviceState *dev)return NULL ; } -void acpi_cpu_plug_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp) {AcpiCpuStatus *cdev;
@@ -264,7 +264,7 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, } } -void acpi_cpu_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb (const HotplugHandler *hotplug_dev,CPUHotplugState *cpu_st,DeviceState *dev,Error **errp) {
hw/acpi/generic_event_device.c +6 -5
@@ -45,7 +45,8 @@ static const uint32_t ged_supported_events[] = {* affected by the interrupt. This way, we can support up to 32 events * with a unique interrupt. */ -void build_ged_aml (Aml *table,const char *name,HotplugHandler *hotplug_dev, +void build_ged_aml (Aml *table,const char *name, +const HotplugHandler *hotplug_dev,uint32_t ged_irq,AmlRegionSpace rs,hwaddr ged_base) {const AcpiGedState *s =ACPI_GED (hotplug_dev);
@@ -250,7 +251,7 @@ static const MemoryRegionOps ged_regs_ops = { }, }; -static void acpi_ged_device_pre_plug_cb (HotplugHandler *hotplug_dev, +static void acpi_ged_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) {
@@ -258,7 +259,7 @@ static void acpi_ged_device_pre_plug_cb(HotplugHandler *hotplug_dev, } } -static void acpi_ged_device_plug_cb (HotplugHandler *hotplug_dev, +static void acpi_ged_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {AcpiGedState *s =ACPI_GED (hotplug_dev);
@@ -279,7 +280,7 @@ static void acpi_ged_device_plug_cb(HotplugHandler *hotplug_dev, } } -static void acpi_ged_unplug_request_cb (HotplugHandler *hotplug_dev, +static void acpi_ged_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {AcpiGedState *s =ACPI_GED (hotplug_dev);
@@ -298,7 +299,7 @@ static void acpi_ged_unplug_request_cb(HotplugHandler *hotplug_dev, } } -static void acpi_ged_unplug_cb (HotplugHandler *hotplug_dev, +static void acpi_ged_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {AcpiGedState *s =ACPI_GED (hotplug_dev);
hw/acpi/ich9.c +5 -5
@@ -410,7 +410,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset)#undef PM_REG_FIELD -void ich9_pm_device_pre_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev);
@@ -432,7 +432,7 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } } -void ich9_pm_device_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev);
@@ -455,7 +455,7 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } } -void ich9_pm_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void ich9_pm_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev);
@@ -489,7 +489,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, } } -void ich9_pm_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void ich9_pm_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev);
@@ -507,7 +507,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } } -bool ich9_pm_is_hotpluggable_bus (HotplugHandler *hotplug_dev,BusState *bus) +bool ich9_pm_is_hotpluggable_bus (const HotplugHandler *hotplug_dev,BusState *bus) {ICH9LPCState *lpc =ICH9_LPC_DEVICE (hotplug_dev);return acpi_pcihp_is_hotpluggable_bus (&lpc->pm.acpi_pci_hotplug, bus);
hw/acpi/memory_hotplug.c +3 -3
@@ -166,7 +166,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, mdev->is_removing = false;trace_mhp_acpi_clear_remove_evt (mem_st->selector); }else if (data &8 ) { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;if (!mdev->is_enabled) {trace_mhp_acpi_ejecting_invalid_slot (mem_st->selector);
@@ -254,7 +254,7 @@ acpi_memory_slot_status(MemHotplugState *mem_st,return &mem_st->devs[slot]; } -void acpi_memory_plug_cb (HotplugHandler *hotplug_dev,MemHotplugState *mem_st, +void acpi_memory_plug_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp) {MemStatus *mdev;
@@ -277,7 +277,7 @@ void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem_st, } } -void acpi_memory_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb (const HotplugHandler *hotplug_dev,MemHotplugState *mem_st,DeviceState *dev,Error **errp) {
hw/acpi/nvdimm.c +1 -1
@@ -887,7 +887,7 @@ static const MemoryRegionOps nvdimm_dsm_ops = { }, }; -void nvdimm_acpi_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev) +void nvdimm_acpi_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev) {if (dev->hotplugged) {acpi_send_event (DEVICE (hotplug_dev),ACPI_NVDIMM_HOTPLUG_STATUS );
hw/acpi/pcihp.c +5 -5
@@ -209,7 +209,7 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, unsigned bsel, unsigned slo*/ qdev->pending_deleted_event = false; }else { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl; hotplug_ctrl =qdev_get_hotplug_handler (qdev);hotplug_handler_unplug (hotplug_ctrl, qdev, &error_abort);
@@ -261,7 +261,7 @@ void acpi_pcihp_reset(AcpiPciHpState *s)acpi_pcihp_update (s); } -void acpi_pcihp_device_pre_plug_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *pdev =PCI_DEVICE (dev);
@@ -275,7 +275,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, } } -void acpi_pcihp_device_plug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_plug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) {PCIDevice *pdev =PCI_DEVICE (dev);
@@ -317,7 +317,7 @@ void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,acpi_send_event (DEVICE (hotplug_dev),ACPI_PCI_HOTPLUG_STATUS ); } -void acpi_pcihp_device_unplug_cb (HotplugHandler *hotplug_dev,AcpiPciHpState *s, +void acpi_pcihp_device_unplug_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) {PCIDevice *pdev =PCI_DEVICE (dev);
@@ -328,7 +328,7 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,qdev_unrealize (dev); } -void acpi_pcihp_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb (const HotplugHandler *hotplug_dev,AcpiPciHpState *s,DeviceState *dev,Error **errp) {
hw/acpi/piix4.c +6 -6
@@ -303,8 +303,8 @@ static void piix4_pm_powerdown_req(Notifier *n, void *opaque)acpi_pm1_evt_power_down (&s->ar); } -static void piix4_device_pre_plug_cb (HotplugHandler *hotplug_dev, -DeviceState *dev,Error **errp) +static void piix4_device_pre_plug_cb (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {PIIX4PMState *s =PIIX4_PM (hotplug_dev);
@@ -323,7 +323,7 @@ static void piix4_device_pre_plug_cb(HotplugHandler *hotplug_dev, } } -static void piix4_device_plug_cb (HotplugHandler *hotplug_dev, +static void piix4_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PIIX4PMState *s =PIIX4_PM (hotplug_dev);
@@ -344,7 +344,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, } } -static void piix4_device_unplug_request_cb (HotplugHandler *hotplug_dev, +static void piix4_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PIIX4PMState *s =PIIX4_PM (hotplug_dev);
@@ -364,7 +364,7 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev, } } -static void piix4_device_unplug_cb (HotplugHandler *hotplug_dev, +static void piix4_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PIIX4PMState *s =PIIX4_PM (hotplug_dev);
@@ -383,7 +383,7 @@ static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev, } } -static bool piix4_is_hotpluggable_bus (HotplugHandler *hotplug_dev, +static bool piix4_is_hotpluggable_bus (const HotplugHandler *hotplug_dev,BusState *bus) {PIIX4PMState *s =PIIX4_PM (hotplug_dev);
hw/arm/virt.c +12 -11
@@ -3753,7 +3753,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)return ms->possible_cpus; } -static void virt_memory_pre_plug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void virt_memory_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3779,7 +3779,7 @@ static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), errp); } -static void virt_memory_plug (HotplugHandler *hotplug_dev, +static void virt_memory_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3798,7 +3798,7 @@ static void virt_memory_plug(HotplugHandler *hotplug_dev, } } -static void virt_machine_device_pre_plug_cb (HotplugHandler *hotplug_dev, +static void virt_machine_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3896,7 +3896,7 @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, } } -static void virt_machine_device_plug_cb (HotplugHandler *hotplug_dev, +static void virt_machine_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3957,7 +3957,7 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, } } -static void virt_dimm_unplug_request (HotplugHandler *hotplug_dev, +static void virt_dimm_unplug_request (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3977,7 +3977,7 @@ static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev, errp); } -static void virt_dimm_unplug (HotplugHandler *hotplug_dev, +static void virt_dimm_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtMachineState *vms =VIRT_MACHINE (hotplug_dev);
@@ -3995,8 +3995,9 @@ out:error_propagate (errp, local_err); } -static void virt_machine_device_unplug_request_cb (HotplugHandler *hotplug_dev, -DeviceState *dev,Error **errp) +static void +virt_machine_device_unplug_request_cb (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {virt_dimm_unplug_request (hotplug_dev, dev, errp);
@@ -4009,7 +4010,7 @@ static void virt_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev, } } -static void virt_machine_device_unplug_cb (HotplugHandler *hotplug_dev, +static void virt_machine_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {
@@ -4022,8 +4023,8 @@ static void virt_machine_device_unplug_cb(HotplugHandler *hotplug_dev, } } -static HotplugHandler *virt_machine_get_hotplug_handler (MachineState *machine, -DeviceState *dev) +static const HotplugHandler * +virt_machine_get_hotplug_handler (MachineState *machine,DeviceState *dev) {MachineClass *mc =MACHINE_GET_CLASS (machine);
hw/char/virtio-serial-bus.c +1 -1
@@ -975,7 +975,7 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp) port->elem =NULL ; } -static void virtser_port_device_plug (HotplugHandler *hotplug_dev, +static void virtser_port_device_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtIOSerialPort *port =VIRTIO_SERIAL_PORT (dev);
hw/core/hotplug.c +4 -4
@@ -13,7 +13,7 @@#include "hw/core/hotplug.h" #include "qemu/module.h" -void hotplug_handler_pre_plug (HotplugHandler *plug_handler, +void hotplug_handler_pre_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {
@@ -24,7 +24,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handler, } } -void hotplug_handler_plug (HotplugHandler *plug_handler, +void hotplug_handler_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {
@@ -35,7 +35,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, } } -void hotplug_handler_unplug_request (HotplugHandler *plug_handler, +void hotplug_handler_unplug_request (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {
@@ -46,7 +46,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_handler, } } -void hotplug_handler_unplug (HotplugHandler *plug_handler, +void hotplug_handler_unplug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {
hw/core/qdev-hotplug.c +5 -5
@@ -14,7 +14,7 @@#include "hw/core/boards.h" #include "qapi/error.h" -HotplugHandler *qdev_get_machine_hotplug_handler (DeviceState *dev) +const HotplugHandler *qdev_get_machine_hotplug_handler (DeviceState *dev) {MachineState *machine;MachineClass *mc;
@@ -90,7 +90,7 @@ bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp)qdev_hotplug_unplug_allowed_common (dev, dev->parent_bus, errp); } -HotplugHandler *qdev_get_bus_hotplug_handler (DeviceState *dev) +const HotplugHandler *qdev_get_bus_hotplug_handler (DeviceState *dev) {if (dev->parent_bus) {return dev->parent_bus->hotplug_handler;
@@ -98,9 +98,9 @@ HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev)return NULL ; } -HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) +const HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) { -HotplugHandler *hotplug_ctrl =qdev_get_machine_hotplug_handler (dev); +const HotplugHandler *hotplug_ctrl =qdev_get_machine_hotplug_handler (dev);if (hotplug_ctrl ==NULL && dev->parent_bus) { hotplug_ctrl =qdev_get_bus_hotplug_handler (dev);
@@ -109,7 +109,7 @@ HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) }/* can be used as ->unplug() callback for the simple cases */ -void qdev_simple_device_unplug_cb (HotplugHandler *hotplug_dev, +void qdev_simple_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {qdev_unrealize (dev);
hw/core/qdev.c +1 -1
@@ -501,7 +501,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp) {DeviceState *dev =DEVICE (obj);DeviceClass *dc =DEVICE_GET_CLASS (dev); -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;BusState *bus;NamedClockList *ncl;Error *local_err =NULL ;
hw/i386/microvm.c +6 -6
@@ -416,7 +416,7 @@ static void microvm_fix_kernel_cmdline(MachineState *machine)g_free (cmdline); } -static void microvm_device_pre_plug_cb (HotplugHandler *hotplug_dev, +static void microvm_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {X86CPU *cpu =X86_CPU (dev);
@@ -425,26 +425,26 @@ static void microvm_device_pre_plug_cb(HotplugHandler *hotplug_dev,x86_cpu_pre_plug (hotplug_dev, dev, errp); } -static void microvm_device_plug_cb (HotplugHandler *hotplug_dev, +static void microvm_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {x86_cpu_plug (hotplug_dev, dev, errp); } -static void microvm_device_unplug_request_cb (HotplugHandler *hotplug_dev, +static void microvm_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {error_setg (errp,"unplug not supported by microvm" ); } -static void microvm_device_unplug_cb (HotplugHandler *hotplug_dev, +static void microvm_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {error_setg (errp,"unplug not supported by microvm" ); } -static HotplugHandler *microvm_get_hotplug_handler (MachineState *machine, -DeviceState *dev) +static const HotplugHandler *microvm_get_hotplug_handler (MachineState *machine, +DeviceState *dev) {if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {return HOTPLUG_HANDLER (machine);
hw/i386/pc.c +14 -14
@@ -1181,7 +1181,7 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs)g_free (i8259); } -static void pc_memory_pre_plug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void pc_memory_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {const X86MachineState *x86ms =X86_MACHINE (hotplug_dev);
@@ -1214,7 +1214,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,pc_dimm_pre_plug (PC_DIMM (dev),MACHINE (hotplug_dev), errp); } -static void pc_memory_plug (HotplugHandler *hotplug_dev, +static void pc_memory_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCMachineState *pcms =PC_MACHINE (hotplug_dev);
@@ -1231,7 +1231,7 @@ static void pc_memory_plug(HotplugHandler *hotplug_dev,hotplug_handler_plug (x86ms->acpi_dev, dev, &error_abort); } -static void pc_memory_unplug_request (HotplugHandler *hotplug_dev, +static void pc_memory_unplug_request (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {X86MachineState *x86ms =X86_MACHINE (hotplug_dev);
@@ -1256,7 +1256,7 @@ static void pc_memory_unplug_request(HotplugHandler *hotplug_dev, errp); } -static void pc_memory_unplug (HotplugHandler *hotplug_dev, +static void pc_memory_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCMachineState *pcms =PC_MACHINE (hotplug_dev);
@@ -1274,7 +1274,7 @@ static void pc_memory_unplug(HotplugHandler *hotplug_dev,error_propagate (errp, local_err); } -static void pc_hv_balloon_pre_plug (HotplugHandler *hotplug_dev, +static void pc_hv_balloon_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {/* The vmbus handler has no hotplug handler; we should never end up here. */
@@ -1282,13 +1282,13 @@ static void pc_hv_balloon_pre_plug(HotplugHandler *hotplug_dev,memory_device_pre_plug (MEMORY_DEVICE (dev),MACHINE (hotplug_dev), errp); } -static void pc_hv_balloon_plug (HotplugHandler *hotplug_dev, +static void pc_hv_balloon_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {memory_device_plug (MEMORY_DEVICE (dev),MACHINE (hotplug_dev)); } -static void pc_sp_mem_pre_plug (HotplugHandler *hotplug_dev, +static void pc_sp_mem_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {MachineState *ms =MACHINE (hotplug_dev);
@@ -1304,7 +1304,7 @@ static void pc_sp_mem_pre_plug(HotplugHandler *hotplug_dev,memory_device_pre_plug (MEMORY_DEVICE (dev), ms, errp); } -static void pc_sp_mem_plug (HotplugHandler *hotplug_dev, +static void pc_sp_mem_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {SpMemDevice *spm =SP_MEM (dev);
@@ -1318,7 +1318,7 @@ static void pc_sp_mem_plug(HotplugHandler *hotplug_dev,e820_add_entry (addr, size,E820_SOFT_RESERVED ); } -static void pc_machine_device_pre_plug_cb (HotplugHandler *hotplug_dev, +static void pc_machine_device_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {
@@ -1356,7 +1356,7 @@ static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, } } -static void pc_machine_device_plug_cb (HotplugHandler *hotplug_dev, +static void pc_machine_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {
@@ -1372,7 +1372,7 @@ static void pc_machine_device_plug_cb(HotplugHandler *hotplug_dev, } } -static void pc_machine_device_unplug_request_cb (HotplugHandler *hotplug_dev, +static void pc_machine_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {
@@ -1388,7 +1388,7 @@ static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev, } } -static void pc_machine_device_unplug_cb (HotplugHandler *hotplug_dev, +static void pc_machine_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_PC_DIMM )) {
@@ -1403,8 +1403,8 @@ static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev, } } -static HotplugHandler *pc_get_hotplug_handler (MachineState *machine, -DeviceState *dev) +static const HotplugHandler *pc_get_hotplug_handler (MachineState *machine, +DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) || object_dynamic_cast(OBJECT(dev), TYPE_SP_MEM) ||
hw/i386/x86-common.c +4 -4
@@ -158,7 +158,7 @@ static CPUArchId *x86_find_cpu_slot(MachineState *ms, uint32_t id, int *idx)return found_cpu; } -void x86_cpu_plug (HotplugHandler *hotplug_dev, +void x86_cpu_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {CPUArchId *found_cpu;
@@ -199,7 +199,7 @@ out:error_propagate (errp, local_err); } -void x86_cpu_unplug_request_cb (HotplugHandler *hotplug_dev, +void x86_cpu_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {int idx =-1 ;
@@ -222,7 +222,7 @@ void x86_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, errp); } -void x86_cpu_unplug_cb (HotplugHandler *hotplug_dev, +void x86_cpu_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {CPUArchId *found_cpu;
@@ -248,7 +248,7 @@ void x86_cpu_unplug_cb(HotplugHandler *hotplug_dev,error_propagate (errp, local_err); } -void x86_cpu_pre_plug (HotplugHandler *hotplug_dev, +void x86_cpu_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {int idx;
hw/intc/loongarch_dintc.c +4 -4
@@ -159,8 +159,8 @@ static DINTCCore *loongarch_dintc_get_cpu(LoongArchDINTCState *s,return NULL ; } -static void loongarch_dintc_cpu_plug (HotplugHandler *hotplug_dev, -DeviceState *dev,Error **errp) +static void loongarch_dintc_cpu_plug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {LoongArchDINTCState *s =LOONGARCH_DINTC (hotplug_dev);Object *obj =OBJECT (dev);
@@ -185,8 +185,8 @@ static void loongarch_dintc_cpu_plug(HotplugHandler *hotplug_dev,return ; } -static void loongarch_dintc_cpu_unplug (HotplugHandler *hotplug_dev, -DeviceState *dev,Error **errp) +static void loongarch_dintc_cpu_unplug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {LoongArchDINTCState *s =LOONGARCH_DINTC (hotplug_dev);Object *obj =OBJECT (dev);
hw/intc/loongarch_extioi_common.c +2 -2
@@ -28,7 +28,7 @@ static ExtIOICore *loongarch_extioi_get_cpu(LoongArchExtIOICommonState *s,return NULL ; } -static void loongarch_extioi_cpu_plug (HotplugHandler *hotplug_dev, +static void loongarch_extioi_cpu_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {LoongArchExtIOICommonState *s =LOONGARCH_EXTIOI_COMMON (hotplug_dev);
@@ -60,7 +60,7 @@ static void loongarch_extioi_cpu_plug(HotplugHandler *hotplug_dev, } } -static void loongarch_extioi_cpu_unplug (HotplugHandler *hotplug_dev, +static void loongarch_extioi_cpu_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {LoongArchExtIOICommonState *s =LOONGARCH_EXTIOI_COMMON (hotplug_dev);
hw/intc/loongarch_ipi.c +2 -2
@@ -128,7 +128,7 @@ static void loongarch_ipi_reset_hold(Object *obj, ResetType type) } } -static void loongarch_ipi_cpu_plug (HotplugHandler *hotplug_dev, +static void loongarch_ipi_cpu_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {LoongsonIPICommonState *lics =LOONGSON_IPI_COMMON (hotplug_dev);
@@ -154,7 +154,7 @@ static void loongarch_ipi_cpu_plug(HotplugHandler *hotplug_dev,qdev_connect_gpio_out (DEVICE (lics), index,qdev_get_gpio_in (dev,IRQ_IPI )); } -static void loongarch_ipi_cpu_unplug (HotplugHandler *hotplug_dev, +static void loongarch_ipi_cpu_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {LoongsonIPICommonState *lics =LOONGSON_IPI_COMMON (hotplug_dev);
hw/loongarch/virt.c +22 -22
120 lines not on this page · raw message
hw/net/virtio-net.c +2 -2
@@ -3749,7 +3749,7 @@ void virtio_net_set_netclient_name(VirtIONet *n, const char *name,static bool failover_unplug_primary (VirtIONet *n,DeviceState *dev) { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;PCIDevice *pci_dev;Error *err =NULL ;
@@ -3772,7 +3772,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev, Error **errp) {Error *err =NULL ; -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;PCIDevice *pdev =PCI_DEVICE (dev);BusState *primary_bus;
hw/nvme/ctrl.c +4 -4
@@ -10595,8 +10595,8 @@ static const TypeInfo nvme_info = { }, }; -static void nvme_ns_hot_plug (HotplugHandler *hotplug_dev,DeviceState *dev, -Error **errp) +static void nvme_ns_hot_plug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {NvmeNamespace *ns =NVME_NS (dev);NvmeSubsystem *subsys = ns->subsys;
@@ -10627,8 +10627,8 @@ static void nvme_ns_hot_plug(HotplugHandler *hotplug_dev, DeviceState *dev, } } -static void nvme_ns_hot_unplug (HotplugHandler *hotplug_dev,DeviceState *dev, -Error **errp) +static void nvme_ns_hot_unplug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {NvmeNamespace *ns =NVME_NS (dev);NvmeSubsystem *subsys = ns->subsys;
hw/pci-bridge/pci_bridge_dev.c +3 -3
@@ -205,7 +205,7 @@ static const VMStateDescription pci_bridge_dev_vmstate = { } }; -void pci_bridge_dev_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pci_bridge_dev_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *pci_hotplug_dev =PCI_DEVICE (hotplug_dev);
@@ -218,7 +218,7 @@ void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,shpc_device_plug_cb (hotplug_dev, dev, errp); } -void pci_bridge_dev_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pci_bridge_dev_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *pci_hotplug_dev =PCI_DEVICE (hotplug_dev);
@@ -227,7 +227,7 @@ void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,shpc_device_unplug_cb (hotplug_dev, dev, errp); } -void pci_bridge_dev_unplug_request_cb (HotplugHandler *hotplug_dev, +void pci_bridge_dev_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *pci_hotplug_dev =PCI_DEVICE (hotplug_dev);
hw/pci/pcie.c +5 -5
@@ -508,7 +508,7 @@ static void pcie_cap_slot_plug_common(PCIDevice *hotplug_dev, DeviceState *dev, } } -void pcie_cap_slot_pre_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_pre_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *hotplug_pdev =PCI_DEVICE (hotplug_dev);
@@ -525,7 +525,7 @@ void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,pcie_cap_slot_plug_common (PCI_DEVICE (hotplug_dev), dev, errp); } -void pcie_cap_slot_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *hotplug_pdev =PCI_DEVICE (hotplug_dev);
@@ -571,7 +571,7 @@ void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } } -void pcie_cap_slot_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void pcie_cap_slot_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {qdev_unrealize (dev);
@@ -579,7 +579,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,static void pcie_unplug_device (PCIBus *bus,PCIDevice *dev,void *opaque) { -HotplugHandler *hotplug_ctrl =qdev_get_hotplug_handler (DEVICE (dev)); +const HotplugHandler *hotplug_ctrl =qdev_get_hotplug_handler (DEVICE (dev));if (dev->partially_hotplugged) { dev->qdev.pending_deleted_event = false;
@@ -608,7 +608,7 @@ static void pcie_cap_slot_do_unplug(PCIDevice *dev) PCI_EXP_SLTSTA_PDC); } -void pcie_cap_slot_unplug_request_cb (HotplugHandler *hotplug_dev, +void pcie_cap_slot_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {Error *local_err =NULL ;
hw/pci/pcie_port.c +1 -1
@@ -188,7 +188,7 @@ int pcie_count_ds_ports(PCIBus *bus)return dsp_count; } -static bool pcie_slot_is_hotpluggable_bus (HotplugHandler *plug_handler, +static bool pcie_slot_is_hotpluggable_bus (const HotplugHandler *plug_handler,BusState *bus) {PCIESlot *s =PCIE_SLOT (bus->parent);
hw/pci/shpc.c +5 -5
@@ -278,7 +278,7 @@ static void shpc_free_devices_in_slot(SHPCDevice *shpc, int slot) ++devfn) {PCIDevice *affected_dev = shpc->sec_bus->devices[devfn];if (affected_dev) { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl; hotplug_ctrl =qdev_get_hotplug_handler (DEVICE (affected_dev)); hotplug_handler_unplug(hotplug_ctrl, DEVICE(affected_dev),
@@ -561,8 +561,8 @@ static bool shpc_device_get_slot(PCIDevice *affected_dev, int *slot,return true; } -void shpc_device_plug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, -Error **errp) +void shpc_device_plug_cb (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {PCIDevice *pci_hotplug_dev =PCI_DEVICE (hotplug_dev);SHPCDevice *shpc = pci_hotplug_dev->shpc;
@@ -601,13 +601,13 @@ void shpc_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,shpc_interrupt_update (pci_hotplug_dev); } -void shpc_device_unplug_cb (HotplugHandler *hotplug_dev,DeviceState *dev, +void shpc_device_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {qdev_unrealize (dev); } -void shpc_device_unplug_request_cb (HotplugHandler *hotplug_dev, +void shpc_device_unplug_request_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PCIDevice *pci_hotplug_dev =PCI_DEVICE (hotplug_dev);
hw/ppc/e500plat.c +2 -2
@@ -42,7 +42,7 @@ static void e500plat_init(MachineState *machine)ppce500_init (machine); } -static void e500plat_machine_device_plug_cb (HotplugHandler *hotplug_dev, +static void e500plat_machine_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PPCE500MachineState *pms =PPCE500_MACHINE (hotplug_dev);
@@ -53,7 +53,7 @@ static void e500plat_machine_device_plug_cb(HotplugHandler *hotplug_dev, } } -static +static const HotplugHandler *e500plat_machine_get_hotpug_handler (MachineState *machine,DeviceState *dev) {
hw/ppc/spapr.c +24 -24
183 lines not on this page · raw message
hw/ppc/spapr_nvdimm.c +1 -1
@@ -64,7 +64,7 @@ struct SPAPRNVDIMMClass {void (*unrealize)(NVDIMMDevice *dimm,Error **errp); }; -bool spapr_nvdimm_validate (HotplugHandler *hotplug_dev,NVDIMMDevice *nvdimm, +bool spapr_nvdimm_validate (const HotplugHandler *hotplug_dev,NVDIMMDevice *nvdimm,uint64_t size,Error **errp) {const MachineClass *mc =MACHINE_GET_CLASS (hotplug_dev);
hw/ppc/spapr_pci.c +6 -6
@@ -1445,7 +1445,7 @@ static int spapr_dt_pci_device(SpaprPhbState *sphb, PCIDevice *dev,/* Callback to be called during DRC release. */ void spapr_phb_remove_pci_device_cb (DeviceState *dev) { -HotplugHandler *hotplug_ctrl =qdev_get_hotplug_handler (dev); +const HotplugHandler *hotplug_ctrl =qdev_get_hotplug_handler (dev);hotplug_handler_unplug (hotplug_ctrl, dev, &error_abort);object_unparent (OBJECT (dev));
@@ -1454,7 +1454,7 @@ void spapr_phb_remove_pci_device_cb(DeviceState *dev)int spapr_pci_dt_populate (SpaprDrc *drc,SpaprMachineState *spapr,void *fdt,int *fdt_start_offset,Error **errp) { -HotplugHandler *plug_handler =qdev_get_hotplug_handler (drc->dev); +const HotplugHandler *plug_handler =qdev_get_hotplug_handler (drc->dev);SpaprPhbState *sphb =SPAPR_PCI_HOST_BRIDGE (plug_handler);PCIDevice *pdev =PCI_DEVICE (drc->dev);
@@ -1521,7 +1521,7 @@ static bool bridge_has_valid_chassis_nr(Object *bridge, Error **errp)return true; } -static void spapr_pci_pre_plug (HotplugHandler *plug_handler, +static void spapr_pci_pre_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {SpaprPhbState *phb =SPAPR_PCI_HOST_BRIDGE (DEVICE (plug_handler));
@@ -1556,7 +1556,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler, } } -static void spapr_pci_plug (HotplugHandler *plug_handler, +static void spapr_pci_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {SpaprPhbState *phb =SPAPR_PCI_HOST_BRIDGE (DEVICE (plug_handler));
@@ -1614,7 +1614,7 @@ static void spapr_pci_bridge_unplug(SpaprPhbState *phb,remove_drcs (phb, bus); } -static void spapr_pci_unplug (HotplugHandler *plug_handler, +static void spapr_pci_unplug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {SpaprPhbState *phb =SPAPR_PCI_HOST_BRIDGE (DEVICE (plug_handler));
@@ -1639,7 +1639,7 @@ static void spapr_pci_unplug(HotplugHandler *plug_handler,qdev_unrealize (plugged_dev); } -static void spapr_pci_unplug_request (HotplugHandler *plug_handler, +static void spapr_pci_unplug_request (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {SpaprPhbState *phb =SPAPR_PCI_HOST_BRIDGE (DEVICE (plug_handler));
hw/remote/machine.c +1 -1
@@ -111,7 +111,7 @@ static void remote_machine_instance_init(Object *obj) s->auto_shutdown = true; } -static void remote_machine_dev_unplug_cb (HotplugHandler *hotplug_dev, +static void remote_machine_dev_unplug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {qdev_unrealize (dev);
hw/riscv/virt.c +3 -3
@@ -1693,8 +1693,8 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name,visit_type_OnOffAuto (v, name, &s->acpi, errp); } -static HotplugHandler *virt_machine_get_hotplug_handler (MachineState *machine, -DeviceState *dev) +static const HotplugHandler * +virt_machine_get_hotplug_handler (MachineState *machine,DeviceState *dev) {MachineClass *mc =MACHINE_GET_CLASS (machine);RISCVVirtState *s =RISCV_VIRT_MACHINE (machine);
@@ -1709,7 +1709,7 @@ static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine,return NULL ; } -static void virt_machine_device_plug_cb (HotplugHandler *hotplug_dev, +static void virt_machine_device_plug_cb (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {RISCVVirtState *s =RISCV_VIRT_MACHINE (hotplug_dev);
hw/s390x/css-bridge.c +1 -1
@@ -26,7 +26,7 @@* (including sending a channel report to the guest) and remove the * device from the virtual css bus. */ -static void ccw_device_unplug (HotplugHandler *hotplug_dev, +static void ccw_device_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {CcwDevice *ccw_dev =CCW_DEVICE (dev);
hw/s390x/s390-pci-bus.c +6 -6
@@ -158,7 +158,7 @@ static void s390_pci_shutdown_notifier(Notifier *n, void *opaque)static void s390_pci_perform_unplug (S390PCIBusDevice *pbdev) { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;if (pbdev->pft ==ZPCI_PFT_ISM ) {notifier_remove (&pbdev->shutdown_notifier);
@@ -1005,8 +1005,8 @@ static bool s390_pci_alloc_idx(S390pciState *s, S390PCIBusDevice *pbdev)return true; } -static void s390_pcihost_pre_plug (HotplugHandler *hotplug_dev,DeviceState *dev, -Error **errp) +static void s390_pcihost_pre_plug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {S390pciState *s =S390_PCI_HOST_BRIDGE (hotplug_dev);
@@ -1079,7 +1079,7 @@ static int s390_pci_interp_plug(S390pciState *s, S390PCIBusDevice *pbdev)return 0 ; } -static void s390_pcihost_plug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void s390_pcihost_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {S390pciState *s =S390_PCI_HOST_BRIDGE (hotplug_dev);
@@ -1216,7 +1216,7 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev, } } -static void s390_pcihost_unplug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void s390_pcihost_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {S390pciState *s =S390_PCI_HOST_BRIDGE (hotplug_dev);
@@ -1255,7 +1255,7 @@ static void s390_pcihost_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, } } -static void s390_pcihost_unplug_request (HotplugHandler *hotplug_dev, +static void s390_pcihost_unplug_request (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {
hw/s390x/s390-virtio-ccw.c +8 -8
@@ -343,8 +343,8 @@ static void ccw_init(MachineState *machine) } -static void s390_cpu_plug (HotplugHandler *hotplug_dev, -DeviceState *dev,Error **errp) +static void s390_cpu_plug (const HotplugHandler *hotplug_dev, +DeviceState *dev,Error **errp) {ERRP_GUARD ();MachineState *ms =MACHINE (hotplug_dev);
@@ -608,7 +608,7 @@ out_lock:bql_lock (); } -static void s390_machine_device_pre_plug (HotplugHandler *hotplug_dev, +static void s390_machine_device_pre_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_VIRTIO_MD_CCW )) {
@@ -618,7 +618,7 @@ static void s390_machine_device_pre_plug(HotplugHandler *hotplug_dev, } } -static void s390_machine_device_plug (HotplugHandler *hotplug_dev, +static void s390_machine_device_plug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {S390CcwMachineState *s390ms =S390_CCW_MACHINE (hotplug_dev);
@@ -648,7 +648,7 @@ static void s390_machine_device_plug(HotplugHandler *hotplug_dev, } } -static void s390_machine_device_unplug_request (HotplugHandler *hotplug_dev, +static void s390_machine_device_unplug_request (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {
@@ -662,7 +662,7 @@ static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev, } } -static void s390_machine_device_unplug (HotplugHandler *hotplug_dev, +static void s390_machine_device_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {if (object_dynamic_cast (OBJECT (dev),TYPE_VIRTIO_MD_CCW )) {
@@ -715,8 +715,8 @@ static const CPUArchIdList *s390_possible_cpu_arch_ids(MachineState *ms)return ms->possible_cpus; } -static HotplugHandler *s390_get_hotplug_handler (MachineState *machine, -DeviceState *dev) +static const HotplugHandler *s390_get_hotplug_handler (MachineState *machine, +DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) || object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW) ||
hw/s390x/virtio-ccw-md.c +4 -4
@@ -19,7 +19,7 @@void virtio_ccw_md_pre_plug (VirtIOMDCcw *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
@@ -48,7 +48,7 @@ void virtio_ccw_md_pre_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp)void virtio_ccw_md_plug (VirtIOMDCcw *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
@@ -72,7 +72,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, MachineState *ms, {VirtIOMDCcwClass *vmdc =VIRTIO_MD_CCW_GET_CLASS (vmd);DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);const HotplugHandlerClass *hdc;Error *local_err =NULL ;
@@ -112,7 +112,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, MachineState *ms,void virtio_ccw_md_unplug (VirtIOMDCcw *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
hw/s390x/virtio-ccw.c +1 -1
@@ -1235,7 +1235,7 @@ static void virtio_ccw_busdev_unrealize(DeviceState *dev)virtio_ccw_device_unrealize (_dev); } -static void virtio_ccw_busdev_unplug (HotplugHandler *hotplug_dev, +static void virtio_ccw_busdev_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtioCcwDevice *_dev =to_virtio_ccw_dev_fast (dev);
hw/scsi/virtio-scsi.c +3 -3
@@ -1140,14 +1140,14 @@ static void virtio_scsi_change(SCSIBus *bus, SCSIDevice *dev, SCSISense sense) } } -static void virtio_scsi_pre_hotplug (HotplugHandler *hotplug_dev, +static void virtio_scsi_pre_hotplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {SCSIDevice *sd =SCSI_DEVICE (dev); sd->hba_supports_iothread = true; } -static void virtio_scsi_hotplug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void virtio_scsi_hotplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (hotplug_dev);
@@ -1179,7 +1179,7 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, } } -static void virtio_scsi_hotunplug (HotplugHandler *hotplug_dev,DeviceState *dev, +static void virtio_scsi_hotunplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (hotplug_dev);
hw/scsi/vmw_pvscsi.c +2 -2
@@ -612,7 +612,7 @@ pvscsi_send_msg(PVSCSIState *s, SCSIDevice *dev, uint32_t msg_type) }static void -pvscsi_hotplug (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) +pvscsi_hotplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PVSCSIState *s =PVSCSI (hotplug_dev);
@@ -620,7 +620,7 @@ pvscsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) }static void -pvscsi_hot_unplug (HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) +pvscsi_hot_unplug (const HotplugHandler *hotplug_dev,DeviceState *dev,Error **errp) {PVSCSIState *s =PVSCSI (hotplug_dev);
hw/virtio/virtio-md-pci.c +4 -4
@@ -19,7 +19,7 @@void virtio_md_pci_pre_plug (VirtIOMDPCI *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
@@ -47,7 +47,7 @@ void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp)void virtio_md_pci_plug (VirtIOMDPCI *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
@@ -71,7 +71,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms, {VirtIOMDPCIClass *vmdc =VIRTIO_MD_PCI_GET_CLASS (vmd);DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);const HotplugHandlerClass *hdc;Error *local_err =NULL ;
@@ -110,7 +110,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, MachineState *ms,void virtio_md_pci_unplug (VirtIOMDPCI *vmd,MachineState *ms,Error **errp) {DeviceState *dev =DEVICE (vmd); -HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev); +const HotplugHandler *bus_handler =qdev_get_bus_hotplug_handler (dev);MemoryDeviceState *md =MEMORY_DEVICE (vmd);Error *local_err =NULL ;
hw/xen/xen-bus.c +1 -1
@@ -374,7 +374,7 @@ fail:g_free (key); } -static void xen_bus_unplug_request (HotplugHandler *hotplug, +static void xen_bus_unplug_request (const HotplugHandler *hotplug,DeviceState *dev,Error **errp) {
stubs/hotplug-stubs.c +3 -3
@@ -14,19 +14,19 @@#include "qemu/osdep.h" #include "hw/core/qdev.h" -HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) +const HotplugHandler *qdev_get_hotplug_handler (DeviceState *dev) {return NULL ; } -void hotplug_handler_pre_plug (HotplugHandler *plug_handler, +void hotplug_handler_pre_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {g_assert_not_reached (); } -void hotplug_handler_plug (HotplugHandler *plug_handler, +void hotplug_handler_plug (const HotplugHandler *plug_handler,DeviceState *plugged_dev,Error **errp) {
system/qdev-monitor.c +1 -1
@@ -917,7 +917,7 @@ static DeviceState *find_device_state(const char *id, bool use_generic_error,void qdev_unplug (DeviceState *dev,Error **errp) { -HotplugHandler *hotplug_ctrl; +const HotplugHandler *hotplug_ctrl;const HotplugHandlerClass *hdc;Error *local_err =NULL ;
Signature · 1 line
2.53.0