OSDN Git Service

qdev: add "hotpluggable" property to Device
authorIgor Mammedov <imammedo@redhat.com>
Wed, 5 Feb 2014 15:36:46 +0000 (16:36 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Feb 2014 08:23:35 +0000 (10:23 +0200)
commit1a37eca107cece3ed454bae29eef0bd1fac4a244
tree48db83a3a7ecc56cf02291f8b784de5c1f340ce4
parent0ee4de6ce1d403b3d8017b340cec772c3c5c106f
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>
hw/core/qdev.c
include/hw/qdev-core.h