Bug 1529256

Summary: Error message is not correct when "vol-upload" a non-existing file with vol-key in logical/iscsi pool
Product: Red Hat Enterprise Linux 7 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: yisun
Severity: low Docs Contact:
Priority: low    
Version: 7.5CC: dyuan, jferlan, lmen, xuzhang, yisun
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-4.3.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:52:20 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 2017-12-27 10:42:02 UTC
Description of problem:
Error message is not correct when "vol-upload" a non-existing file with vol-key in logical/iscsi pool

Version-Release number of selected component:
libvirt-3.9.0-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a volume in iscsi(or logical) pool
# virsh vol-list iscsi
Name Path 
------------------------------------------------------------------------------
unit:0:0:0 /dev/disk/by-path/ip-10.66.70.106:3260-iscsi-iqn.1994-05.com.redhat:test-target-lun-0

# virsh vol-key --pool iscsi --vol unit:0:0:0
3600140590027d1f90474ffb826f03f72

2. Upload a non-existing file to the volume with volume key:
# virsh vol-upload --pool iscsi --vol 3600140590027d1f90474ffb826f03f72 /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa
error: cannot read /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa
error: Storage volume not found: no storage vol with matching name '3600140590027d1f90474ffb826f03f72'

Actual results:
Upload fails, and print error message:
error: cannot read /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa
error: Storage volume not found: no storage vol with matching name '3600140590027d1f90474ffb826f03f72'

Expected results:
Upload fails, and print error message: "error: cannot read /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa"


Additional info:

Comment 2 John Ferlan 2018-04-16 15:56:46 UTC
Patch posted upstream:

https://www.redhat.com/archives/libvir-list/2018-April/msg01353.html

Comment 3 John Ferlan 2018-04-17 15:22:54 UTC
Patch pushed:

$ git describe 0d6e8341031ab1b23b89c15574b2b0a08ef3c3b1 
v4.2.0-259-g0d6e834103
$

Comment 5 yisun 2018-06-13 08:35:50 UTC
test with libvirt-4.3.0-1.virtcov.el7.x86_64 and PASSED

Steps:
1. having a iscsi/logical pool
# virsh pool-dumpxml iscsi
<pool type='iscsi'>
  <name>iscsi</name>
  <uuid>978f4cd7-e782-4cec-8687-5f67b13cb7ac</uuid>
  <capacity unit='bytes'>2097152000</capacity>
  <allocation unit='bytes'>2097152000</allocation>
  <available unit='bytes'>0</available>
  <source>
    <host name='127.0.0.1'/>
    <device path='iqn.2016-03.com.virttest:logical-pool.target'/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
  </target>
</pool>


2. having existing vol
# virsh vol-list iscsi
 Name                 Path                                    
------------------------------------------------------------------------------
 unit:0:0:0           /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2016-03.com.virttest:logical-pool.target-lun-0

# virsh vol-key --pool iscsi --vol unit:0:0:0
36001405a6218f03f3914101b114b8693

3. do the vol-upload
# virsh vol-upload --pool iscsi --vol 36001405a6218f03f3914101b114b8693 /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa
error: cannot read /tmp/upload-file-aaaaaaaaaaaaaaaaaaaaaaa

The error message is clear now.

Comment 7 errata-xmlrpc 2018-10-30 09:52:20 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.

https://access.redhat.com/errata/RHSA-2018:3113