Bug 1299688

Summary: storage: Improve error message when delete snapshots for a non-rbd backend
Product: [Community] Virtualization Tools Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, dyuan, jferlan, mzhan, yafu
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-18 09:55:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fangge Jin 2016-01-19 01:49:08 UTC
Description of problem:
The error message when deleting snapshots for a non-rbd backend is not clear:
# virsh undefine rhel7.2 --delete-snapshots --remove-all-storage
Domain rhel7.2 has been undefined
error: Failed to remove storage volume 'vda'(/var/lib/libvirt/images/test.img)
error: unsupported flags (0x2) in function virStorageBackendFileSystemVolDelete


# virsh vol-delete /var/lib/libvirt/images/test.img --delete-snapshots
error: Failed to delete vol /var/lib/libvirt/images/test.img
error: unsupported flags (0x2) in function virStorageBackendFileSystemVolDelete


Version-Release number of selected component (if applicable):
# git describe
v1.3.1-rc2



How reproducible:
100%

Steps to Reproduce:
1. Prepare a volume in default storage pool
# virsh vol-list default
 Name                 Path                                    
------------------------------------------------------------------------------
 test.img             /var/lib/libvirt/images/test.img    

2.Try to delete the volume with its snapshots:
# virsh vol-delete /var/lib/libvirt/images/test.img --delete-snapshots
error: Failed to delete vol /var/lib/libvirt/images/test.img
error: unsupported flags (0x2) in function virStorageBackendFileSystemVolDelete

3.Prepare a guest with a non-rbd disk:
# virsh domblklist rhel7.2
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/test.img

Try to undefine the guest with --delete-snapshots:
# virsh undefine rhel7.2 --delete-snapshots --remove-all-storage
Domain rhel7.2 has been undefined
error: Failed to remove storage volume 'vda'(/var/lib/libvirt/images/test.img)
error: unsupported flags (0x2) in function virStorageBackendFileSystemVolDelete


Actual results:
As step 2&3, the error message is not clear.

Expected results:
The error message is clear, like:
error: delete snapshots is not supported for non-rbd backend

Comment 1 Daniel Berrangé 2021-08-18 09:55:04 UTC
Closing since there's been no effort to address this in 5 years and no active complaints from users.