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

Reply via email to