[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]