mirror of
https://github.com/qemu/qemu.git
synced 2024-11-30 07:13:38 +08:00
qemu-iotests: Test unplug of -device without drive
This caused an assertion failure until recently because the BlockBackend would be detached on unplug, but was in fact never attached in the first place. Add a regression test. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
e1824e585f
commit
208c38e4e4
@ -137,6 +137,19 @@ run_qemu <<EOF
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo === Empty drive with -device and device_del ===
|
||||
echo
|
||||
|
||||
run_qemu -device virtio-scsi-pci -device scsi-cd,id=cd0 <<EOF
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "query-block" }
|
||||
{ "execute": "device_del", "arguments": { "id": "cd0" } }
|
||||
{ "execute": "system_reset" }
|
||||
{ "execute": "query-block" }
|
||||
{ "execute": "quit" }
|
||||
EOF
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
rm -f $seq.full
|
||||
|
@ -416,4 +416,43 @@ Testing:
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
|
||||
=== Empty drive with -device and device_del ===
|
||||
|
||||
Testing: -device virtio-scsi-pci -device scsi-cd,id=cd0
|
||||
{
|
||||
QMP_VERSION
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"device": "",
|
||||
"locked": false,
|
||||
"removable": true,
|
||||
"qdev": "cd0",
|
||||
"tray_open": false,
|
||||
"type": "unknown"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"return": [
|
||||
]
|
||||
}
|
||||
{
|
||||
"return": {
|
||||
}
|
||||
}
|
||||
*** done
|
||||
|
Loading…
Reference in New Issue
Block a user