From: "Andreas Färber" <afaerber@suse.de>
To: liguang <lig.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method
Date: Mon, 18 Mar 2013 09:25:10 +0100 [thread overview]
Message-ID: <5146CF66.9080501@suse.de> (raw)
In-Reply-To: <1363161681-13878-3-git-send-email-lig.fnst@cn.fujitsu.com>
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.fnst@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
next prev parent reply other threads:[~2013-03-18 8:26 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 8:01 [Qemu-devel] [PATCH][RFC 0/14] implement power chip liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 01/14] gitignore: ignore more files liguang
2013-03-21 6:24 ` li guang
2013-03-21 10:43 ` Peter Maydell
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method liguang
2013-03-18 8:25 ` Andreas Färber [this message]
2013-03-18 8:29 ` li guang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 03/14] qdev: remove redundant abort() liguang
2013-03-18 8:26 ` Andreas Färber
2013-03-21 6:24 ` li guang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 04/14] qdev: add power on/off/suspend/wakeup handler liguang
2013-03-18 8:31 ` Andreas Färber
2013-03-18 8:34 ` li guang
2013-03-13 8:01 ` liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 06/14] sysemu: remove PowerReason in sysemu.h liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 07/14] acpi: refactor acpi wakeup function liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 08/14] ich9: make lpc's reset also do pm_reset liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 09/14] ich9: do lpc's power on by reset function liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 10/14] piix4: refactor piix4's power callbacks liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 11/14] pckbd: refactor pckbd's " liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 12/14] ps2: call ps2_{kbd, mouse}_reset in kbd_reset liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 13/14] parallel: refactor parallel_reset function liguang
2013-03-13 8:01 ` [Qemu-devel] [PATCH][RFC 14/14] uhci: refactor uhci's power callbacks liguang
2013-03-15 0:59 ` [Qemu-devel] [PATCH][RFC 0/14] implement power chip li guang
2013-03-18 6:12 ` li guang
2013-03-18 8:34 ` Andreas Färber
2013-03-18 8:41 ` li guang
2013-03-18 11:07 ` Peter Maydell
2013-03-19 0:55 ` li guang
2013-03-19 9:05 ` Peter Maydell
2013-03-19 9:31 ` li guang
2013-03-19 10:15 ` Peter Maydell
2013-03-20 0:56 ` li guang
2013-03-20 10:50 ` Peter Maydell
2013-03-21 0:36 ` li guang
2013-03-21 10:41 ` Peter Maydell
2013-03-22 0:31 ` li guang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5146CF66.9080501@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=lig.fnst@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).