mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qdev: hotplug for bus-less devices
Add get_hotplug_handler() method to machine, and make bus-less device use it during hotplug as a means to discover a hotplug handler controller. The returned controller is used to perform hotplug actions. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
c270fb9eff
commit
b745454811
2 changed files with 21 additions and 0 deletions
|
@ -61,6 +61,11 @@ extern MachineState *current_machine;
|
|||
/**
|
||||
* MachineClass:
|
||||
* @qemu_machine: #QEMUMachine
|
||||
* @get_hotplug_handler: this function is called during bus-less
|
||||
* device hotplug. If defined it returns pointer to an instance
|
||||
* of HotplugHandler object, which handles hotplug operation
|
||||
* for a given @dev. It may return NULL if @dev doesn't require
|
||||
* any actions to be performed by hotplug handler.
|
||||
*/
|
||||
struct MachineClass {
|
||||
/*< private >*/
|
||||
|
@ -90,6 +95,9 @@ struct MachineClass {
|
|||
const char *default_boot_order;
|
||||
GlobalProperty *compat_props;
|
||||
const char *hw_version;
|
||||
|
||||
HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
|
||||
DeviceState *dev);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue