Description of problem:
With libvirt 0.8.3, when snapshots are linked to their parent snapshot, if the parent snapshot is deleted, the snapshot chain becomes broken. Deleting a child snapshot then terminates with an error message:
error: Domain snapshot not found: no domain snapshot parent with matching
I can reproduce this using the following sequence of commands for my test-domain called "test" using a single qcow2 image:
# virsh snapshot-create test # 1291813670
# virsh snapshot-create test # 1291813671
# virsh snapshot-create test # 1291813672
# virsh snapshot-delete test 1291813671
# virsh snapshot-delete test 1291813672
Reverting to such an unlinked snapshot is still possible, but deleting it doesn't work.
Version-Release number of selected component (if applicable):
The unlinked child snapshot should be deleted when requested, instead of generating the error message about a missing parent snapshot.
This error was reported by Philipp Hahn on the libvirt developers mailing list:
Philipp, how big a problem is this? Is it a matter of the snapshots hanging around, or does it prevent the guest from operating?
(In reply to comment #1)
> Philipp, how big a problem is this? Is it a matter of the snapshots hanging
> around, or does it prevent the guest from operating?
Snapshots still work: I can revert back to them just fine.
Only if I try to delete a snapshot whichs parent snapshot is already deleted, this operation fails.
This is because the the snapshot contains a reference to the parent snapshot, which is than dangling. If I edit the snapshot file /var/lib/libvirt/qemu/snapshot/$VM_NAME/$SNAPSHOT_NAME.xml by hand and remove the danling /domainsnapshot/parent/name entity, I can than delete the snapshot using libvirt.
This has been fixed upsteam: