Menu

#453 USB connection lost on device restart

open
nobody
qemu (66)
5
2012-10-09
2009-06-29
No

I was trying to upgrade my Nokia 5800 phone using Nokia Software Updater on a Windows XP (32bits) virtual machine running inside a AMD host (using Gentoo with a vanilla kernel : Linux lantia 2.6.30 #1 SMP PREEMPT Tue Jun 16 16:46:42 CEST 2009 x86_64 AMD Turion(tm) X2 Ultra Dual-Core Mobile ZM-82 AuthenticAMD GNU/Linux) using KVM userland tools 85.

It runs fine until the end of the download of the first package when the phone need to reboot in order to continue with the second package.
At this moment as the device is reseted, the usb device number change in the kernel and the virtual machine lost the connection to it, which make the update failed because I think the virtual machine is no longer aware that the device is here (the software in the VM is waiting as if we had removed the device).

Here is the output of the lsusb command before and after the device reboot :
Bus 001 Device 007: ID 0421:0154 Nokia Mobile Phones
Bus 001 Device 008: ID 0421:0154 Nokia Mobile Phones

As we can seen on http://www.inspirated.com/wordpress/2009/03/15/howto-use-usb-devices-in-virtual-machine-manager-with-qemu , I'm not the first one to have this specific problem.
Searching over google, I found many problem related to this issue (for example some devices loosing connection after going into powersaving mode).

I'm thinking that a possible solution is that once a USB device is added by its ID in qemu using usb_add, then if the device disapear temporarly and reappear with another device number, then it should be automaticly readded and shared to the virtual machine.
I don't know if it's an easy things to do as I never looked inside the linux-kvm code, but I hope it's possible at least.

Discussion


Log in to post a comment.