xapi-project/xenopsd — pull request #134 by djs55 (2014-09-13 18:22:25+00:00)
Title: xenlight: avoid the VM power_state becoming paused after a suspend

The power state (as viewed by xenopsd clients) glitches at the end of suspend.
It seems that libxl actively pauses the shutdown suspended domain. This
shouldn't by itself cause a problem but I suspect that libxl's domain_destroy
is asynchronous: like libxc it just means 'set the destroy bit', not the
common english meaning of destroy i.e. 'domain, begone, and be all ways
away'[1]. Once the domain has been 'destroyed' then xapi will be allowed to
'stat' the domain, xenopsd will see a suspended, shutdown, paused *and*
destroyed domain and report this as 'paused' (!). This triggers an assertion
failure in xapi's VM.suspend.

We fix this by waiting for the destroyed domain to disappear. We should
consider also resetting the domain's uuid in a future patch.

Signed-off-by: David Scott

[1] Shakespeare, A Midsummer Night's dream, Act 4, Scene 1