Add a qemu_img_map() function by analogy with qemu_img_measure(),
qemu_img_check(), and qemu_img_info() that all return JSON information.
Replace calls to qemu_img_pipe('map', '--output=json', ...) with this
new function, which provides better diagnostic information on failure.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/041 | 5 ++---
tests/qemu-iotests/211 | 6 +++---
tests/qemu-iotests/iotests.py | 3 +++
tests/qemu-iotests/tests/block-status-cache | 11 ++++-------
tests/qemu-iotests/tests/parallels-read-bitmap | 6 ++----
5 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211
index f52cadade1..1a3b4596c8 100755
--- a/tests/qemu-iotests/211
+++ b/tests/qemu-iotests/211
@@ -59,7 +59,7 @@ with iotests.FilePath('t.vdi') as disk_path, \
vm.shutdown()
iotests.img_info_log(disk_path)
- iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path))
+ iotests.log(iotests.qemu_img_map(disk_path))
#
# Successful image creation (explicit defaults)
@@ -83,7 +83,7 @@ with iotests.FilePath('t.vdi') as disk_path, \
vm.shutdown()
iotests.img_info_log(disk_path)
- iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path))
+ iotests.log(iotests.qemu_img_map(disk_path))
#
# Successful image creation (with non-default options)
@@ -107,7 +107,7 @@ with iotests.FilePath('t.vdi') as disk_path, \
vm.shutdown()
iotests.img_info_log(disk_path)
- iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path))
+ iotests.log(iotests.qemu_img_map(disk_path))
#
# Invalid BlockdevRef