Re: [PATCH 3/4] qemu: snapshot: Forbid empty snapshots

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

 



On 05/20/2014 07:36 AM, Peter Krempa wrote:
> If neither disks nor memory are selected for snapshot we'd record
> metadata in case of external snapshot and do a disk snapshot in case of
> external disk snapshot. Forbid this as it doesn't make much sense.
> ---
> 
> Notes:
>     There's a slightly usable case where this would be used to backup domain's config.

Hmm.  Down the road, when we start integrating chain operations (pull,
commit) more closely with snapshots, we may hit the case where a
blockpull goes through and modifies a snapshot to record that the disk
snapshot taken at that point of time was invalidated by the chain
operation.  Perhaps we could still leave the empty snapshot in the list
of snapshots, and if so, then this code should also allow creation of
empty snapshots.  But I tend to agree that it sounds rather pointless to
track empty snapshots, so I'd rather have chain operations delete
snapshots that are otherwise rendered empty, and agree with the approach
of this patch in forbidding an empty snapshot.  Someone wanting to
preserve configuration can use virsh dumpxml.


> +++ b/src/qemu/qemu_driver.c
> @@ -12703,6 +12703,13 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
>          }
>      }
> 
> +    if (!found_internal && !external &&
> +        def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("nothing selected for snapshot"));
> +        goto cleanup;
> +    }

ACK.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]