Bug 814866
Summary: | libvirt does not allow usb redirection.. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Thomas Davis <tdavis> | ||||
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 17 | CC: | berrange, clalancette, crobinso, dougsland, itamar, jforbes, jyang, laine, libvirt-maint, mprivozn, veillard, virt-maint | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-0.9.11.3-1.fc17 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2012-05-02 20:55:43 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Thomas Davis
2012-04-20 21:21:44 UTC
Created attachment 579116 [details]
A variable is used before it's set; depends on compiler doing the right thing.
Sets the dev->used_by to NULL before it's used.
I've tested and booted on a F17 KVM using a libvirt 0.9.11 patched RPM; rpm -qa | grep libvirt libvirt-daemon-0.9.11-1.fc17.x86_64 libvirt-python-0.9.11-1.fc17.x86_64 libvirt-client-0.9.11-1.fc17.x86_64 libvirt-daemon-kvm-0.9.11-1.fc17.x86_64 What you're adding is a NOP - VIR_ALLOC(dev) (in the lines just above where you set dev->used_by = NULL) ends up calling calloc(), so the memory is all initialized to 0 anyway. The real fix is to apply the following three upstream patches, which unfortunately were pushed after 0.9.11 was released (but since it was so soon afterward, they should apply cleanly): commit b2c7b9ee0e6f2203984035668c066be37f3a256a Author: Michal Privoznik <mprivozn> Date: Mon Mar 26 16:33:58 2012 +0200 qemu: Don't leak temporary list of USB devices and add debug message when adding USB device to the list of active devices. commit e2f5dd6134ebeb6846450c7d7782273d3d274859 Author: Michal Privoznik <mprivozn> Date: Mon Mar 26 16:40:01 2012 +0200 qemu: Delete USB devices used by domain on stop To prevent assigning one USB device to two domains, we keep a list of assigned USB devices. On domain startup - qemuProcessStart() - we insert devices used by domain into the list but remove them only on detach-device. Devices are, however, released on qemuProcessStop() as well. commit ea3bc548aca7b4c448b48863120ad35a7337c127 Author: Michal Privoznik <mprivozn> Date: Mon Mar 26 16:44:19 2012 +0200 qemu: Build activeUsbHostdevs list on process reconnect If the daemon is restarted it will lose list of active USB devices assigned to active domains. Therefore we need to rebuild this list on qemuProcessReconnect(). Setting to POST to catch the attention of the next person to do a build (Hi Cole!) Interesting. Funny that's supposed to be zero'd out, but adding that NULL fixed the problem for the moment.. I'll wait for the next build, and see what it does. Ok, I found had some free moments.. those 3 patches do fix the problem, I reversed what I did and applied just those 3 patches. Installed and it worked. Thomas, dev->used_by is there to protect a USB device 'dev' to be assigned to another domain. Basically, if it's NULL it is not used by any domain and vice versa: if it is NOT NULL, it points to a domain name that holds this device. Therefore, if forcibly set this to NULL, all subsequent checks would pass as 'dev' is thought to be free but it's not. libvirt-0.9.11.3-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/libvirt-0.9.11.3-1.fc17 Package libvirt-0.9.11.3-1.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libvirt-0.9.11.3-1.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-6964/libvirt-0.9.11.3-1.fc17 then log in and leave karma (feedback). (In reply to comment #6) > Thomas, > > dev->used_by is there to protect a USB device 'dev' to be assigned to another > domain. Basically, if it's NULL it is not used by any domain and vice versa: if > it is NOT NULL, it points to a domain name that holds this device. Therefore, > if forcibly set this to NULL, all subsequent checks would pass as 'dev' is > thought to be free but it's not. Yes, I see that is what being attempted.. I'll give the updates a whirl. libvirt-0.9.11.3-1.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. |