Bug 1696211

Summary: 'qemu-img map' for an image file over NBD fails
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Tingting Mao <timao>
Component: qemu-kvmAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Tingting Mao <timao>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: chayang, coli, ddepaula, eblake, jsnow, juzhang, ngu, qzhang, timao, virt-maint
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-4.1.0-1.module+el8.1.0+3966+4a23dca1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-06 07:14:08 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 Tingting Mao 2019-04-04 10:54:27 UTC
Description of problem:
'qemu-img map' for a image image over NBD fails.


Version-Release number of selected component (if applicable):
qemu-kvm-3.1.0-20.module+el8+2904+e658c755
kernel-4.18.0-80.el8


How reproducible:
2/2


Steps to Reproduce:

1.Create a image file and export it by NBD
# qemu-img create -f raw test.img 512M 
Formatting 'test.img', fmt=raw size=536870912
# qemu-nbd -f raw -p 9000 test.img -t

2. Dump the metadata of the image
# qemu-img map nbd:localhost:9000


Actual results:
Client:
# qemu-img map nbd:localhost:9000
Offset          Length          Mapped to       File
qemu-img: File contains external, encrypted or compressed clusters.

Server:
# qemu-nbd -f raw -p 9000 test.img -t
Disconnect client, due to: Unexpected end-of-file before all bytes were read


Expected results:
Dump the metadata successfully, and there is no error info from the server.


Additional info:

Comment 4 Tingting Mao 2019-08-19 06:52:18 UTC
Tried to verify this bug as below:


Tested with:
qemu-kvm-4.1.0-1.module+el8.1.0+3966+4a23dca1
kernel-4.18.0-134.el8


Steps:
In Server:
# qemu-img create -f raw test.img 512M

# qemu-nbd -f raw -p 9000 test.img -t

In client:
Map with default/human
# qemu-img map nbd:localhost:9000
Offset          Length          Mapped to       File

Map with json
# qemu-img map nbd:localhost:9000 --output=json
[{ "start": 0, "length": 536870912, "depth": 0, "zero": true, "data": true, "offset": 0}]


Results:
In server, there is no error info anymore.
# qemu-nbd -f raw -p 9000 test.img -t

In client, like above.

Comment 6 errata-xmlrpc 2019-11-06 07:14:08 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/RHBA-2019:3723