]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - tests/qemu-iotests/060
block: Close a BlockDriverState completely even when bs->drv is NULL
[thirdparty/qemu.git] / tests / qemu-iotests / 060
index 1eca09417ba157c4e6f6ea5c49ef7d47d107ed46..14797dd3b0e74c452c1b3963c7f9d40bed89cd60 100755 (executable)
@@ -426,6 +426,19 @@ echo '--- Repairing ---'
 _check_test_img -q -r all
 _check_test_img -r all
 
+echo
+echo "=== Testing the QEMU shutdown with a corrupted image ==="
+echo
+_make_test_img 64M
+poke_file "$TEST_IMG" "$rt_offset"        "\x00\x00\x00\x00\x00\x00\x00\x00"
+echo "{'execute': 'qmp_capabilities'}
+      {'execute': 'human-monitor-command',
+       'arguments': {'command-line': 'qemu-io drive \"write 0 512\"'}}
+      {'execute': 'quit'}" \
+    | $QEMU -qmp stdio -nographic -nodefaults \
+            -drive if=none,node-name=drive,file="$TEST_IMG",driver=qcow2 \
+    | _filter_qmp | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full