mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00

It is desirable for 'qemu-img map' to have the same output for a file
whether it is served over file or nbd protocols. However, ever since
we implemented block status for NBD (2.12), the NBD protocol forgot to
inform the block layer that as the final layer in the chain, the
offset is valid; without an offset, the human-readable form of
qemu-img map gives up with the unhelpful:
$ nbdkit -U - data data="1" size=512 --run 'qemu-img map $nbd'
Offset Length Mapped to File
qemu-img: File contains external, encrypted or compressed clusters.
The --output=json form always works, because it is reporting the
lower-level bdrv_block_status results directly rather than trying to
filter out sparse ranges for human consumption - but now it also
shows the offset member.
With this patch, the human output changes to:
Offset Length Mapped to File
0 0x200 0 nbd+unix://?socket=/tmp/nbdkitOxeoLa/socket
This change is observable to several iotests.
Fixes: 78a33ab5
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190329042750.14704-4-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26 lines
1.1 KiB
Text
26 lines
1.1 KiB
Text
QA output created by 241
|
|
|
|
=== Exporting unaligned raw image, natural alignment ===
|
|
|
|
size: 1024
|
|
min block: 512
|
|
[{ "start": 0, "length": 1024, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
|
|
1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)
|
|
|
|
=== Exporting unaligned raw image, forced server sector alignment ===
|
|
|
|
WARNING: Image format was not specified for '/home/eblake/qemu/tests/qemu-iotests/scratch/t.raw' and probing guessed raw.
|
|
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
|
|
Specify the 'raw' format explicitly to remove the restrictions.
|
|
size: 1024
|
|
min block: 512
|
|
[{ "start": 0, "length": 1024, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
|
|
1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)
|
|
|
|
=== Exporting unaligned raw image, forced client sector alignment ===
|
|
|
|
size: 1024
|
|
min block: 512
|
|
[{ "start": 0, "length": 1024, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
|
|
1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)
|
|
*** done
|