diff options
author | Igor Mammedov | 2014-02-05 16:36:46 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2014-02-10 09:23:35 +0100 |
commit | 1a37eca107cece3ed454bae29eef0bd1fac4a244 (patch) | |
tree | 48db83a3a7ecc56cf02291f8b784de5c1f340ce4 /include/hw/qdev-core.h | |
parent | qdev: add to BusState "hotplug-handler" link (diff) | |
download | qemu-1a37eca107cece3ed454bae29eef0bd1fac4a244.tar.gz qemu-1a37eca107cece3ed454bae29eef0bd1fac4a244.tar.xz qemu-1a37eca107cece3ed454bae29eef0bd1fac4a244.zip |
qdev: add "hotpluggable" property to Device
Currently it's possible to make PCIDevice not hotpluggable
by using no_hotplug field of PCIDeviceClass. However it
limits this only to PCI devices and prevents from
generalizing hotplug code.
So add similar field to DeviceClass so it could be reused
with other Devices and would allow to replace PCI specific
hotplug callbacks with generic implementation. Following
patches will replace PCIDeviceClass.no_hotplug with this
new property.
In addition expose field as "hotpluggable" readonly property,
to make it possible to read its value via QOM interface.
Make DeviceClass hotpluggable by default as it was assumed
before.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/qdev-core.h')
-rw-r--r-- | include/hw/qdev-core.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 41ec533acb..08d329da71 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -50,6 +50,8 @@ struct VMStateDescription; * is changed to %true. Deprecated, new types inheriting directly from * TYPE_DEVICE should use @realize instead, new leaf types should consult * their respective parent type. + * @hotpluggable: indicates if #DeviceClass is hotpluggable, available + * as readonly "hotpluggable" property of #DeviceState instance * * # Realization # * Devices are constructed in two stages, @@ -110,6 +112,7 @@ typedef struct DeviceClass { * TODO remove once we're there */ bool cannot_instantiate_with_device_add_yet; + bool hotpluggable; /* callbacks */ void (*reset)(DeviceState *dev); |