]> git.proxmox.com Git - mirror_qemu.git/blobdiff - include/hw/qdev-core.h
qdev/machine: Introduce hotplug_allowed hook
[mirror_qemu.git] / include / hw / qdev-core.h
index 136df7774ca34361a610bff273a590ff8add8984..aa123f88cbc615c745c591a560de759ebe593c0f 100644 (file)
@@ -4,9 +4,7 @@
 #include "qemu/queue.h"
 #include "qemu/bitmap.h"
 #include "qom/object.h"
-#include "hw/irq.h"
 #include "hw/hotplug.h"
-#include "sysemu/sysemu.h"
 
 enum {
     DEV_NVECTORS_UNSPECIFIED = -1,
@@ -36,8 +34,6 @@ typedef void (*DeviceReset)(DeviceState *dev);
 typedef void (*BusRealize)(BusState *bus, Error **errp);
 typedef void (*BusUnrealize)(BusState *bus, Error **errp);
 
-struct VMStateDescription;
-
 /**
  * DeviceClass:
  * @props: Properties accessing state fields.
@@ -113,7 +109,7 @@ typedef struct DeviceClass {
     DeviceUnrealize unrealize;
 
     /* device state */
-    const struct VMStateDescription *vmsd;
+    const VMStateDescription *vmsd;
 
     /* Private to qdev / bus.  */
     const char *bus_type;
@@ -284,6 +280,7 @@ 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);
+bool qdev_hotplug_allowed(DeviceState *dev, Error **errp);
 /**
  * qdev_get_hotplug_handler: Get handler responsible for device wiring
  *
@@ -426,7 +423,7 @@ void device_class_set_parent_unrealize(DeviceClass *dc,
                                        DeviceUnrealize dev_unrealize,
                                        DeviceUnrealize *parent_unrealize);
 
-const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev);
+const VMStateDescription *qdev_get_vmsd(DeviceState *dev);
 
 const char *qdev_fw_name(DeviceState *dev);
 
@@ -454,8 +451,4 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
 void device_listener_register(DeviceListener *listener);
 void device_listener_unregister(DeviceListener *listener);
 
-VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
-                                                     VMChangeStateHandler *cb,
-                                                     void *opaque);
-
 #endif