husb: support for USB host device auto disconnect (Max Krasnyansky)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 21 Aug 2008 19:27:48 +0000 (19:27 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 21 Aug 2008 19:27:48 +0000 (19:27 +0000)
commit1dbf1d60a157ef73b939e71360e5b3a9ce65e340
treeb6d330c5e7906e7935310141be310c33b44fcefa
parent3a5df0fb720fb8ef6013b46dd0912442c5c0d977
husb: support for USB host device auto disconnect (Max Krasnyansky)

I got really annoyed by the fact that you have to manually do
usb_del in the monitor when host device is unplugged and decided
to fix it :)

Basically we now automatically remove guest USB device
when the actual host device is disconnected.

At first I've extended set_fd_handlerX() stuff to support checking
for exceptions on fds. But unfortunately usbfs code does not wake up
user-space process when device is removed, which means we need a
timer to periodically check if device is still there. So I removed
fd exception stuff and implemented it with the timer.

Signed-off-by: Max Krasnyansky <maxk@kernel.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5047 c046a42c-6fe2-441c-8c8c-71466251a162
hw/usb.h
usb-linux.c
vl.c