[libvirt] [PATCHv2 2/2] qemu: snapshot: Forbid taking/reverting snapshots in PMSUSPENDED state

Eric Blake eblake at redhat.com
Mon Jul 21 18:44:51 UTC 2014


On 07/21/2014 08:08 AM, Peter Krempa wrote:
> Qemu doesn't currently support them and behaves strangely. Just forbid
> them.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1079162
> ---
>  src/qemu/qemu_driver.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 91baa7d..eae23d3 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -13401,9 +13401,14 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
>      case VIR_DOMAIN_SHUTDOWN:
>      case VIR_DOMAIN_SHUTOFF:
>      case VIR_DOMAIN_CRASHED:
> -    case VIR_DOMAIN_PMSUSPENDED:
>          break;
> 
> +    case VIR_DOMAIN_PMSUSPENDED:
> +        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> +                       _("qemu doesn't support taking snapshots of "
> +                         "PMSUSPENDED guests"));
> +        goto cleanup;
> +

This is a bit harsh; a bit nicer might be to take the snapshot anyways
but to have the snapshot be in the running state (as if the act of
taking the snapshot caused a pmwakeup event).  But that's more
complicated, and changes domain state implicitly, while this approach is
vocal to the user why we can't do it (and if qemu ever DOES add support,
we just gate this code by a capability detection bit).

ACK.

-- 
Eric Blake   eblake 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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140721/ffefbe3e/attachment-0001.sig>


More information about the libvir-list mailing list