[libvirt] [PATCH] qemu: handle not supported writable devices

Eric Blake eblake at redhat.com
Fri Feb 15 16:26:30 UTC 2013


On 02/15/2013 07:13 AM, Philipp Hahn wrote:
> If the running VM contains a writable raw image, creating snapshot fails
> internally in QEMU, but the error is not detected by libvirt. Success is
> still reported to the user, who will see the snapshot in libvirt, even
> they are NOT created by qemu.

Libvirt is supposed to already have code that refuses an internal
snapshot on non-qcow2 files.  We must have broken this somewhere in the
recent past.  It would be nice to figure out why
qemuDomainSnapshotPrepare() is failing to do a proper job before we take
this patch. :(

> 
> diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> index bc0a11d..5880ab9 100644
> --- a/src/qemu/qemu_monitor_text.c
> +++ b/src/qemu/qemu_monitor_text.c
> @@ -2854,6 +2854,10 @@ int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name)
>          virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
>          goto cleanup;
>      }
> +    else if (strstr(reply, "does not support snapshots") != NULL) {
> +        virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
> +        goto cleanup;
> +    }

At any rate, this patch makes sense, once we _also_ solve the root cause
of why we are getting here in the first place.

-- 
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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130215/c7d1e1bd/attachment-0001.sig>


More information about the libvir-list mailing list