From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWOA-0003y8-4w for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPWO8-0003TD-T1 for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:06:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWO8-0003Sq-M1 for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:06:56 -0400 Message-ID: <5163F63D.8090109@redhat.com> Date: Tue, 09 Apr 2013 13:06:37 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1365136091-26148-1-git-send-email-lig.fnst@cn.fujitsu.com> <1365136091-26148-4-git-send-email-lig.fnst@cn.fujitsu.com> <515EBA2A.1090005@redhat.com> <1365380334.5674.5.camel@liguang.fnst.cn.fujitsu.com> <516293A5.7030900@redhat.com> <1365492852.9553.14.camel@liguang.fnst.cn.fujitsu.com> <5163C6B4.3070507@redhat.com> <1365495988.9553.62.camel@liguang.fnst.cn.fujitsu.com> In-Reply-To: <1365495988.9553.62.camel@liguang.fnst.cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH][RFC v2 3/7] vl: create power chip device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: li guang Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, aliguori@us.ibm.com, afaerber@suse.de, stefanha@gmail.com Il 09/04/2013 10:26, li guang ha scritto: > > qemu_system_suspend_request, qemu_register_suspend_notifier > > for S0->S3 > > > > qemu_system_wakeup_request, qemu_register_wakeup_notifier > > for S3->S0 > > > > qemu_system_powerdown_request, qemu_register_powerdown_notifier > > for Sx->S5 > > > > and the reset mechanism for S5->S0. > > Yep, I'm trying to supersede these functions > by my power chip emulation. Then I explained in my other message why this is wrong. The API may well be "bad" (if so, please explain why), but at least it is the right tool to model this. QEMU models abstract concepts (memory, timers, powerdown) with APIs, not with devices. Paolo