Cc: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: Andreas Färber <andreas.faer...@web.de> --- hw/isa-bus.c | 9 +++++++++ hw/isa.h | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 2765543..6f296bd 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -156,6 +156,15 @@ ISADevice *isa_create_simple(const char *name) return dev; } +void isa_set_state(ISADevice *dev, bool enabled) +{ + ISADeviceInfo *info = DO_UPCAST(ISADeviceInfo, qdev, dev->qdev.info); + + if (info->set_state != NULL) { + info->set_state(dev, enabled); + } +} + static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent) { ISADevice *d = DO_UPCAST(ISADevice, qdev, dev); diff --git a/hw/isa.h b/hw/isa.h index d2b6126..0e944b9 100644 --- a/hw/isa.h +++ b/hw/isa.h @@ -19,9 +19,11 @@ struct ISADevice { }; typedef int (*isa_qdev_initfn)(ISADevice *dev); +typedef void (*isa_qdev_statefn)(ISADevice *dev, bool enabled); struct ISADeviceInfo { DeviceInfo qdev; isa_qdev_initfn init; + isa_qdev_statefn set_state; }; ISABus *isa_bus_new(DeviceState *dev); @@ -34,6 +36,7 @@ void isa_qdev_register(ISADeviceInfo *info); ISADevice *isa_create(const char *name); ISADevice *isa_try_create(const char *name); ISADevice *isa_create_simple(const char *name); +void isa_set_state(ISADevice *dev, bool enabled); extern target_phys_addr_t isa_mem_base; -- 1.7.5.3