When you shutdown a domain that is in PAUSED state, the shutdown will
not
take effect until you issue a resume cmd:
# virsh suspend <domain_name>
<domain_name> is now PAUSED
# virsh shutdown <domain_name>
<domain_name> does not shutdown, with the reason being that, for
example in the case of a Linux Guest, the guest is not running and
therefore there is no acpid running and able to process the shutdown
request. Right?
If now we issue a resume
#virsh resume <domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes the
pending request).
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown
request?
if (domain.state == PAUSED)
resume(domain)
shutdown(domain)
If yes, then I guess this logic should go
- into the cmdShutdown routine if we want to make it available to virsh
only,
or
- inside the driver's domainShutdown fn if we want to make it available
to any
libvirt user.
One more minor comment.
As of now, "virsh list" (or 'virsh domstate <domain>') does not
provide
any way of
knowing if
- a domain is being shutdown
or
- a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate , for
example to
show something like this when libvirt issues a shutdown to a running
domain
Id Name State
----------------------------------
3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State
----------------------------------
3 FC15-2 PAUSED (shutdown request pending)
Thanks
/Chris