qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method


From: li guang
Subject: Re: [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method
Date: Mon, 18 Mar 2013 16:29:40 +0800

Thanks!

在 2013-03-18一的 09:25 +0100,Andreas Färber写道:
> 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 <address@hidden>
> > ---
> >  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).

OK

> 
> I have the feeling your hooks may be rather x86-specific - have you
> checked against any other architecture?
> 

I'm considering to be generic

> Andreas
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]