Am 13.03.2013 09:01, schrieb liguang: > 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;
Whatever callbacks get added, they should be added down here and get gtk-doc documentation above the struct. That should also include some guidelines on how new devices should implement these (hint: we'd want to avoid code duplication). I have the feeling your hooks may be rather x86-specific - have you checked against any other architecture? Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg