qdev: add "hotplugable" property to Device

Currently it's possible to make PCIDevice not hotplugable 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.

In addition expose field as "hotplugable" readonly property, to make
it possible to get it via QOM interface.

v3:
make DeviceClass hotlugable by default. Since PCIDevice still uses
internal checks it shouldn't reggress. And follow up patch that
converts PCIDevices to use "hotplugable" property will take care
about not hotplugable PCI devices explicitly setting "hotplugable"
to false in their class_init().

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v3:
 move generic hotplug checks from
 "7/11 qdev:pci: refactor PCIDevice to use generic "hotplugable" property"
 to this patch
hw/acpi: move typeinfo to the file end

do so to avoid not necessary forward declarations and
place typeinfo registration at the file end where it's
usualy expected.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
qdev:pci: refactor PCIDevice to use generic "hotplugable" property

Get rid of PCIDevice specific PCIDeviceClass.no_hotplug and use
generic DeviceClass.hotplugable field instead.

Check if hot(un)plug is allowed into common qdev_unplug/device_set_realized,
so that inherited classes won't have to do it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-handler API

Split piix4_device_hotplug() into hotplug/unplug callbacks
and register them as "hotplug-handler" interface implementation of
PIIX4_PM device.

Replace pci_bus_hotplug() wiring with setting link on
PCI BUS "hotplug-handler" property to PIIX4_PM device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pci/shpc: convert SHPC hotplug to use hotplug-handler API

Split shpc_device_hotplug() into hotplug/unplug callbacks
and register them as "hotplug-handler" interface implementation of
PCI_BRIDGE_DEV device.

Replace pci_bus_hotplug() wiring with setting link on PCI BUS
"hotplug-handler" property to PCI_BRIDGE_DEV device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pci/pcie: convert PCIE hotplug to use hotplug-handler API

Split pcie_cap_slot_hotplug() into hotplug/unplug callbacks
and register them as "hotplug-handler" interface implementation of
PCIE_SLOT device.

Replace pci_bus_hotplug() wiring with setting link on PCI BUS
"hotplug-handler" property to PCI_BRIDGE_DEV device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
hw/pci: switch to a generic hotplug handling for PCIDevice

make qdev_unplug()/device_set_realized() to call hotplug handler's
plug/unplug methods if available and remove not needed anymore
hot(un)plug handling from PCIDevice.

In case if hotplug handler is not available, revert to the legacy
hotplug method.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>