RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 903052 - virsh snapshot-delete --children-only bypasses safety check for deleting disk-only children
Summary: virsh snapshot-delete --children-only bypasses safety check for deleting disk...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 956506
TreeView+ depends on / blocked
 
Reported: 2013-01-23 02:27 UTC by hongming
Modified: 2014-04-04 20:59 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 956506 (view as bug list)
Environment:
Last Closed: 2014-04-04 20:59:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description hongming 2013-01-23 02:27:24 UTC
Description of problem:
When virsh-delete with children-only flag for a snapshot without children . the output info of command isn't correct. Libvirt should report error in the scenario. 

Version-Release number of selected component (if applicable):
libvirt-0.10.2-16.el6.x86_64 
qemu-kvm-rhev-0.12.1.2-2.344.el6.x86_64 

How reproducible:
100% 

Steps to Reproduce:
# virsh help snapshot-delete 

...... 
--children-only delete children but not snapshot 
...... 

# virsh snapshot-list rhel6 
Name Creation Time State 
------------------------------------------------------------ 
1358838027 2013-01-22 15:00:27 +0800 shutoff 

# virsh snapshot-delete rhel6 1358838027 --children-only 
Domain snapshot 1358838027 children deleted 

# virsh snapshot-list rhel6 
Name Creation Time State 
------------------------------------------------------------ 
1358838027 2013-01-22 15:00:27 +0800 shutoff 

Actual results:
as above 

Expected results:
Libvirt should report error in the scenario. - for example : error : the snapshot doesn't have any children. 

Additional info:

Comment 2 Eric Blake 2013-01-23 03:16:50 UTC
All 0 children were deleted, and the command returned success.  As long as there are no children after the command completes successfully, I don't think it should matter whether there were children prior to the command.

I think it is probably more effort to add code just to distinguish this case than it is to declare that it is not a bug and live with it.

Comment 3 hongming 2013-01-25 03:36:06 UTC
Hi Eric, the snapshot-delete with --children-only flag can delete the disk-only snapshot. 

# virsh start rhel6
Domain rhel6 started

# virsh snapshot-list rhel6 --tree
internel


# virsh snapshot-create-as rhel6 disk001 --disk-only
Domain snapshot disk001 created

# virsh snapshot-list rhel6 --tree
internel
  |
  +- disk001


# virsh snapshot-delete rhel6 disk001
error: Failed to delete snapshot disk001
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet

# virsh snapshot-delete rhel6 internel --children
error: Failed to delete snapshot internel
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet

# virsh snapshot-delete rhel6 internel --children-only
Domain snapshot internel children deleted

# virsh snapshot-list rhel6 --tree
internel

Comment 4 Eric Blake 2013-01-25 13:40:28 UTC
Ouch - being inconsistent on whether we allow the deletion of disk-only snapshots (all external snapshots, for that matter), is not nice.  I'm retitling this bug.  However, it may be better to wait for upstream to add support for deletion of external snapshots.

Comment 7 Eric Blake 2013-07-12 19:37:12 UTC
Right now, libvirt documents that it refuses to delete external snapshots only because it is not implemented safely; this bug represents a hole where we aren't following the documentation.  Alternatives are to patch code to match docs (quick), or to actually implement snapshot deletion (longer, but more desirable).  I see no need to do a quick patch now only to undo it later when true snapshot deletion is implemented.

Comment 10 RHEL Program Management 2014-04-04 20:59:06 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.