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: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method
Date: Mon, 18 Mar 2013 09:25:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

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).

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



reply via email to

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