Bug 1535992

Summary: Set force shared option "-U" as default option for "qemu-img info"
Product: Red Hat Enterprise Linux 7 Reporter: Yanqiu Zhang <yanqzhan>
Component: qemu-kvm-rhevAssignee: Fam Zheng <famz>
Status: CLOSED ERRATA QA Contact: Ping Li <pingl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: ahino, amureini, areis, chayang, chhu, coli, dyuan, hhan, juzhang, lmiksik, michen, mzhan, ngu, nsoffer, pingl, qzhang, timao, virt-maint, xuzhang, yanqzhan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.10.0-18.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 00:58:52 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 Yanqiu Zhang 2018-01-18 12:13:19 UTC
Description of problem:
Products like RHV using "qemu-img info" to get image info of a running guest will get qemu lock error(Bug 1378241). 
If only add '-U' option in RHV product,e.g.RHV 4.2[1], the old version RHV 4.1 that must run with 7.5 will also encounter the issue.
So expect that setting force shared option "-U" as default option for "qemu-img info".

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.10.0-17.el7.x86_64
libvirt-3.9.0-7.el7.x86_64
vdsm-4.20.13-1.el7ev.x86_64
ovirt-engine-4.2.1.1-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.Start a guest and check its image info by qemu-img info AND with -U
a. # qemu-img info /rhev/data-center/mnt/10.73.194.27:_vol_S3_libvirtmanual_yanqzhan_rhv__nfs__1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1
qemu-img: Could not open '/rhev/data-center/mnt/10.73.194.27:_vol_S3_libvirtmanual_yanqzhan_rhv__nfs__1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1': Failed to get shared "write" lock
Is another process using the image?

b. # qemu-img info -U /rhev/data-center/mnt/10.73.194.27:_vol_S3_libvirtmanual_yanqzhan_rhv__nfs__1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1
image: /rhev/data-center/mnt/10.73.194.27:_vol_S3_libvirtmanual_yanqzhan_rhv__nfs__1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1
file format: qcow2
virtual size: 7.0G (7516192768 bytes)
disk size: 1.3G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

2. On RHV do live storage migration, check the vdsm.log:
# cat vdsm.log|grep ERROR
2018-01-18 04:30:37,367-0500 ERROR (jsonrpc/0) [storage.TaskManager.Task] (Task='13bc9f6e-446f-46a1-a8da-0d4d015f4d45') Unexpected error (task:875)
2018-01-18 04:30:37,368-0500 ERROR (jsonrpc/0) [storage.Dispatcher] FINISH getQemuImageInfo error=Command ['/usr/bin/qemu-img', 'info', '--output', 'json', '-f', 'qcow2', u'/rhev/data-center/mnt/10.73.194.27:_vol_S3_libvirtmanual_yanqzhan_rhv__nfs__1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1'] failed with rc=1 out='' err='qemu-img: Could not open \'/rhev/data-center/mnt/10.73.194.27:vol_S3_libvirtmanual_yanqzhan_rhvnfs_1/ed9643e6-0dae-4511-a8ff-42749439b177/images/0ae9ac30-818d-4440-aa3d-758083d8b9b2/04115713-aa45-40e9-b960-a63a33167ae1\': Failed to get shared "write" lock\nIs another process using the image?\n' (dispatcher:86)

Actual results:
As in steps.

Expected results:
Set force shared option "-U" as default option for "qemu-img info"

Additional info:

Comment 7 Miroslav Rezanina 2018-01-23 13:01:20 UTC
Fix included in qemu-kvm-rhev-2.10.0-18.el7

Comment 11 errata-xmlrpc 2018-04-11 00:58:52 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:1104