Bug 1306564

Summary: Centos-Libvirt: For running vm, virsh vol-delete command fails while deleting SCSI disk image which is added through virt-manager: cannot unlink file 'XXX': Success
Product: Red Hat Enterprise Linux 7 Reporter: amaresh <amaresh_pathak>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: agedosier, berrange, clalancette, crobinso, itamar, jforbes, laine, libvirt-maint, rbalakri, veillard
Target Milestone: rc   
Target Release: 7.3   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-11 19:25:00 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 amaresh 2016-02-11 10:09:34 UTC
Description of problem:

On Centos machine, if we try to delete the SCSI disk image for running vm (which is added via virt-manager) through virsh vol-delete command, getting "cannot unlink file 'XXX': Success" error. 

This error occurs intermittently and occurs only if we try to delete disk image when vm is running.

Version-Release number of selected component (if applicable):

OS:CentOS Linux release 7.2.1511

Libvirt:
[root@CV-HJ-CentOS7-02 images]# virsh version
Compiled against library: libvirt 1.2.17
Using library: libvirt 1.2.17
Using API: QEMU 1.2.17
Running hypervisor: QEMU 1.5.3


How reproducible:


Steps to Reproduce:
1. Add SCSI disk from virt manager to VM
2. Start VM from virt-manager and confirm disk is attached as SCSI.
5. Try to delete the newly added SCSI disk using virsh vol-delete command:
virsh # vol-delete /var/lib/libvirt/images/<filename>.img
 

Actual results:
It is giving Following error:
error: Failed to delete vol /var/lib/libvirt/images/<filename>.img
error: cannot unlink file '/var/lib/libvirt/images/<filename>.img': Success


Expected results:
It should not give any error and should delete the disk image properly.


Additional info:

Comment 1 Laine Stump 2016-02-11 15:09:11 UTC
Fedora Rawhide is not CentOS, and CentOS will not have the version of libvirt that is currently in Fedora Rawhide for "awhile". CentOS has their own downstream bugtracker, which might be the most appropriate place for filing bugs against the versions of packages in CentOS, but since CentOS is based on the corresponding RHEL release, it's also reasonable to file such bugs against the RHEL7 version of the package - this is why I've moved this BZ from Fedora/Rawhide/libvirt to RHEL7/libvirt.

As for the bug, it's highly possible your problem is fixed by the following upstream commit:

commit cb19cff468432e55366014658f405066ce06c2f2
Author: John Ferlan <jferlan>
Date:   Wed Sep 30 17:37:27 2015 -0400

    virfile: Fix error path for forked virFileRemove

This commit reports eliminating the same error message. It first appeared upstream in 1.2.21, and I don't see it backported to the RHEL7 libvirt build.

Comment 3 Cole Robinson 2016-02-11 19:25:00 UTC

*** This bug has been marked as a duplicate of bug 1293804 ***