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:
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.
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