[libvirt] [PATCH v2 4/5] qemu: Wire up virDomainSuspendForDuration API

Eric Blake eblake at redhat.com
Thu Mar 15 23:11:22 UTC 2012


On 01/26/2012 12:59 PM, Michal Privoznik wrote:
> This makes use of QEMU guest agent to implement the
> virDomainSuspendForDuration API.
> ---
>  src/qemu/qemu_driver.c |   93 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 93 insertions(+), 0 deletions(-)

> +
> +    if (!virDomainObjIsActive(vm)) {
> +        qemuReportError(VIR_ERR_OPERATION_INVALID,
> +                        "%s", _("domain is not running"));
> +        goto cleanup;
> +    }

Same question as for quiesce: putting the guest into S3 will only work
if the agent can respond, so checking merely for active is not enough.
If the guest is active but paused, then we can't talk to the agent to
issue the request.  Having the common guest agent code check for this
condition will prevent the scenario of:

guest is paused
issue the pm suspend, but it times out
guest is resumed
guest finally acts on command

although it is always possible that a guest will suspend itself even
without action on our part.  At least this isn't as bad as a stale
quiesce leaving the guest in a bad state, since on suspend, the host
will receive a qemu event about the change in guest state (there's no
event for freeze/thaw, since that is an aspect internal to the guest's
use of disks and not something inherently visible to qemu to generate an
event from).

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120315/fc899578/attachment-0001.sig>


More information about the libvir-list mailing list