In fact, every devices have to be aware of it's power management, so it can decide what to do when platform board switch it's power state between on/off/suspend/wakeup.
Signed-off-by: liguang <lig.f...@cn.fujitsu.com> --- hw/qdev-core.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/qdev-core.h b/hw/qdev-core.h index 2486f36..e69c50b 100644 --- a/hw/qdev-core.h +++ b/hw/qdev-core.h @@ -85,6 +85,12 @@ typedef struct DeviceClass { Property *props; int no_user; + /* power management */ + void (*on)(DeviceState *dev); + void (*off)(DeviceState *dev); + void (*suspend)(DeviceState *dev); + void (*wakeup)(DeviceState *dev); + /* callbacks */ void (*reset)(DeviceState *dev); DeviceRealize realize; -- 1.7.2.5