]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests: Add regression test for commit base locking
authorFam Zheng <famz@redhat.com>
Tue, 13 Mar 2018 14:20:03 +0000 (22:20 +0800)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 Mar 2018 11:01:39 +0000 (12:01 +0100)
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/153
tests/qemu-iotests/153.out

index adfd02695b45d5d5502bc84d691100705f51ad8f..a0fd81548301e791af518889b3c7dd2716fd4242 100755 (executable)
@@ -178,6 +178,18 @@ rm -f "${TEST_IMG}.lnk" &>/dev/null
 ln -s ${TEST_IMG} "${TEST_IMG}.lnk" || echo "Failed to create link"
 _run_qemu_with_images "${TEST_IMG}.lnk" "${TEST_IMG}"
 
+echo
+echo "== Active commit to intermediate layer should work when base in use =="
+_launch_qemu -drive format=$IMGFMT,file="${TEST_IMG}.a",id=drive0,if=none \
+             -device virtio-blk,drive=drive0
+
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'qmp_capabilities' }" \
+    'return'
+_run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
+
+_cleanup_qemu
+
 _launch_qemu
 
 _send_qemu_cmd $QEMU_HANDLE \
index 34309cfb2058334b73da50075845e81dc6358324..bb721cb747c86db66373b32f0b4128e94606e00c 100644 (file)
@@ -372,6 +372,11 @@ Is another process using the image?
 == Symbolic link ==
 QEMU_PROG: -drive if=none,file=TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image?
+
+== Active commit to intermediate layer should work when base in use ==
+{"return": {}}
+
+_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
 {"return": {}}
 Adding drive