No need to substitute qemu-io command.

Signed-off-by: Marc-André Lureau <[email protected]>
---
 tests/qemu-iotests/102     | 21 ++++++++++++++-------
 tests/qemu-iotests/102.out | 12 ++++++++----
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102
index 5db8180d3bb7..b70053eee302 100755
--- a/tests/qemu-iotests/102
+++ b/tests/qemu-iotests/102
@@ -41,7 +41,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto file fuse
-_require_hmp
 
 IMG_SIZE=64K
 
@@ -67,18 +66,26 @@ echo
 _make_test_img $IMG_SIZE
 $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
 
-qemu_comm_method=monitor _launch_qemu -drive if=none,file="$TEST_IMG",id=drv0
+_launch_qemu -drive if=none,file="$TEST_IMG",id=drv0
 
-# Wait for a prompt to appear (so we know qemu has opened the image)
-_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'qmp_capabilities' }" \
+    'return'
 
 $QEMU_IMG resize --shrink --image-opts \
     "driver=raw,file.driver=file,file.filename=$TEST_IMG,file.locking=off" \
     $((5 * 64 * 1024))
 
-_send_qemu_cmd $QEMU_HANDLE 'qemu-io drv0 map' 'allocated' \
-    | sed -e 's/^(qemu).*qemu-io drv0 map...$/(qemu) qemu-io drv0 map/'
-_send_qemu_cmd $QEMU_HANDLE 'quit' ''
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'drv0', 'command': 'map' } }" \
+    'return'
+
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'quit' }" \
+    'return'
+
+wait=1 _cleanup_qemu
 
 # success, all done
 echo '*** done'
diff --git a/tests/qemu-iotests/102.out b/tests/qemu-iotests/102.out
index 320ed5a52ba9..13dee5bdecd6 100644
--- a/tests/qemu-iotests/102.out
+++ b/tests/qemu-iotests/102.out
@@ -15,9 +15,13 @@ Offset          Length          File
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu)
+{ 'execute': 'qmp_capabilities' }
+{"return": {}}
 Image resized.
-(qemu) qemu-io drv0 map
-64 KiB (0x10000) bytes     allocated at offset 0 bytes (0x0)
+{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'drv0', 'command': 'map' } }
+{"return": {"human-readable-text": "64 KiB (0x10000) bytes     allocated at 
offset 0 bytes (0x0)\n"}}
+{ 'execute': 'quit' }
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
+{"return": {}}
 *** done

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to