On Mon, 23 Apr 2012 09:14:18 -0500 Michael Roth <mdr...@linux.vnet.ibm.com> wrote:
> So, currently, libvirt waits indefinitely (till guest wake-up) for > the guest-suspend-* response? I think that's broken, since > guest-suspend-* is documented such that a response is not garaunteed, That's true, but there's a problem on our side too. We say that a response may not be sent, but we also don't document what clients can do to check if the command has been successfully executed. This issue also exists with shutdown, although it's pretty obvious that if qemu exits with a status code of zero then it has powered down (or the user did that her/himself, which doesn't matter). But this has to be documented to be official. For suspend-ram and suspend-hybrid, the recommended way to know the command has completed is to wait for the SUSPEND event and/or poll for the RunState change (will submit a patch for this). Now, I don't know what to do for suspend-disk. I was hoping that having a different exit status for it was possible, but Gleb says this has problems too as guests may "emulate" S4 by saving ram contents and then powering down. Maybe we could use this anyway and let clients know that a regular exit status is also possible. However, there's another issue. This is out of qemu-ga's realm, but it's interesting to find an unified solution: libvirt also wants to know when the user suspends to S4 from user-space. Having a different status code would be perfect for this...