From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmsEi-0006lz-SR for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:28:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmsEh-000671-Og for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:28:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmsEh-00065n-DQ for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:28:55 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0GJSlkF028357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Jan 2012 14:28:54 -0500 Message-ID: <4F14688E.4000202@redhat.com> Date: Mon, 16 Jan 2012 19:12:30 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1326294541-15080-1-git-send-email-kraxel@redhat.com> <1326294541-15080-2-git-send-email-kraxel@redhat.com> <4F1052F3.2040708@redhat.com> In-Reply-To: <4F1052F3.2040708@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/5] suspend: add infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel On 01/13/12 16:51, Paolo Bonzini wrote: > On 01/11/2012 04:08 PM, Gerd Hoffmann wrote: >> +void qemu_system_suspend_request(qemu_irq wake_irq) >> +{ >> + if (suspend_wake_irq != NULL) { >> + return; >> + } >> + cpu_stop_current(); >> + qemu_notify_event(); >> + suspend_wake_irq = wake_irq; >> +} >> + >> +void qemu_system_wakeup_request(void) >> +{ >> + if (suspend_wake_irq == NULL) { >> + return; >> + } >> + reset_requested = 1; >> + qemu_irq_raise(suspend_wake_irq); >> + suspend_wake_irq = NULL; >> +} > > The code in acpi.c is confusing, but it seems to me that IRQ is raised > when the system _enters_ S3. See especially xen-all.c. > Overall, it seems to me that with your new infrastructure a global > Notifier would be a better fit than a qemu_irq that the board would have > to pass all the way. Indeed. Especially as it isn't actually a IRQ line but just a qemu_irq struct which is abused as notifier ... > A notifier would also remove the ugly Xen special > casing. Yes. > However, this can be done separately. It's easier to do it all in one go. It also gives some bonus points because it'll remove more code than it adds ;) v2 goes out in a minute ... thanks for the review, Gerd