From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHVOL-0002xL-8l for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHVOG-0003yu-4J for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:26:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55113 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHVOF-0003ah-J1 for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:25:55 -0400 Message-ID: <5146CF66.9080501@suse.de> Date: Mon, 18 Mar 2013 09:25:10 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1363161681-13878-1-git-send-email-lig.fnst@cn.fujitsu.com> <1363161681-13878-3-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: <1363161681-13878-3-git-send-email-lig.fnst@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH][RFC 02/14] qdev: add power management method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liguang Cc: qemu-devel@nongnu.org, Anthony Liguori 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. >=20 > Signed-off-by: liguang > --- > hw/qdev-core.h | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) >=20 > 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; > =20 > + /* 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg