I tested this patch with the following command:
x86_64-softmmu/qemu-system-x86_64 --enable-kvm rhel54_1.img -m 1024 -net
tap,ifname=tap0,script=no -net nic,model=virtio -sdl -drive
file=iscsi://127.0.0.1/iqn.2011-09.com.example:server.target1/
And I found that the whole qemu process would get freezed, not reachable
via ping and no response on desktop if there's I/O targeted to the iscsi
drive and the iscsi target was forcefully stopped. After checking the
backtrace with gdb, I found the I/O thread got stuck on the mutex
qemu_global_mutex , which was hold by the vcpu thread. It should be
released before re-entering guest. But the vcpu thread was waiting for
the completion of iscsi aio request endlessly, and therefore couldn't
get chance to release the mutex. So the whole qemu process became
unresponsive. But this problem doesn't exist with the combination of
virtio and iscsi. Only the I/O process got hung on guest in this case.
It's more acceptable. I am not sure how to fix this problem.