Bug 744724

Summary: virsh snapshot-edit allow to change snapshot name and create a new fake snapshot with the new name
Product: Red Hat Enterprise Linux 6 Reporter: yuping zhang <yupzhang>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: acathrow, ajia, dallan, eblake, nzhang, rwu, syeghiay, veillard, whuang, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.4-17.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:37:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 747120    

Description yuping zhang 2011-10-10 10:21:14 UTC
Description of problem:
Use virsh snapshot-edit to edit an exist snapshot,update the snapshot name then save,it will create a new fake snapshot with new name.

Version-Release number of selected component (if applicable):
libvirt-client-0.9.4-16.el6.x86_64
libvirt-0.9.4-16.el6.x86_64
libvirt-python-0.9.4-16.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1.# virsh snapshot-create rhel6
Domain snapshot 1318280132 created

2.# virsh snapshot-list rhel6
 Name                 Creation Time             State
------------------------------------------------------------
 1318280132           2011-10-11 04:55:32 +0800 shutoff

3.# virsh snapshot-edit rhel6 1318280132
  *Change 
  <domainsnapshot>
    <name>1318280132</name>
   ...
to
  <domainsnapshot>
    <name>1318280130</name>
  ...
then save*
 Snapshot 1318280132 edited.

4.# virsh snapshot-list rhel6
 Name                 Creation Time             State
------------------------------------------------------------
 1318280130           2011-10-11 04:55:32 +0800 shutoff
 1318280132           2011-10-11 04:55:32 +0800 shutoff

5.# virsh snapshot-revert rhel6 1318280130
error: internal error Child process (/usr/bin/qemu-img snapshot -a 1318280130 /var/lib/libvirt/images/Winxp-32bit-qcow2-kvm) status unexpected: exit status 1

6.# qemu-img info /var/lib/libvirt/images/rhel6-qcow2
image: /var/lib/libvirt/images/rhel6-qcow2
file format: qcow2
virtual size: 6.0G (6442450944 bytes)
disk size: 1.4G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         1318280132                0 2011-10-11 04:55:32   00:00:00.000

Actual results:
As above.

Expected results:
Virsh snapshot-edit should not allow to change the snapshot name.

Additional info:

Comment 2 Eric Blake 2011-10-10 15:20:43 UTC
Funny that you should find this independently from me proposing the upstream patch just last weekend:

https://www.redhat.com/archives/libvir-list/2011-October/msg00263.html

Comment 6 Huang Wenlong 2011-10-12 05:17:44 UTC
Verify this bug with libvirt-0.9.4-17.el6.x86_64


[root@intel-w3520-12-2 images]# virsh snapshot-create q2
Domain snapshot 1318396559 created
[root@intel-w3520-12-2 images]# virsh snapshot-edit 1318396559
error: command 'snapshot-edit' requires <snapshotname> option
[root@intel-w3520-12-2 images]# virsh snapshot-edit q2 1318396559 
error: Must use --rename or --clone to change 1318396559 to 1318396560

Comment 7 errata-xmlrpc 2011-12-06 11:37:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1513.html