Bug 1389662 - virt-manager doesn't notice new USB device plugged into previously used port
Summary: virt-manager doesn't notice new USB device plugged into previously used port
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-28 07:06 UTC by lnie
Modified: 2017-03-17 18:51 UTC (History)
4 users (show)

Fixed In Version: virt-manager-1.4.1-1.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-17 18:51:20 UTC
Type: Bug


Attachments (Terms of Use)
screenshot (183.64 KB, image/png)
2016-10-28 07:06 UTC, lnie
no flags Details
journal (259.58 KB, text/x-vhdl)
2016-10-28 07:08 UTC, lnie
no flags Details
debug output (18.64 KB, text/plain)
2016-12-23 03:04 UTC, lnie
no flags Details

Description lnie 2016-10-28 07:06:55 UTC
Created attachment 1214855 [details]
screenshot

Description of problem:

please see the attached picture for more specific information,thanks.

Version-Release number of selected component (if applicable):

virt-manager-1.4.0-3.fc25.noarch

How reproducible:
always 

Steps to Reproduce:
1.Insert the Sandisk usb stick to the host machine's usb port,
2.plug out it and insert the Kingston usb
3.Try to add the Kingston usb to the virtual machine using virt-manager

Actual results:


Expected results:


Additional info:

Comment 1 lnie 2016-10-28 07:08:00 UTC
Created attachment 1214856 [details]
journal

Comment 2 Cole Robinson 2016-12-21 21:46:00 UTC
Can you run virt-manager --debug, reproduce the issue, and attach the full text output?

Comment 3 lnie 2016-12-23 03:04:59 UTC
Created attachment 1234945 [details]
debug output

Comment 4 lnie 2016-12-23 03:33:26 UTC
Seems that the issue is: virt-manager will only remember the usb when you first try to add a usb 
The reproduce steps:
1)insert usb A,
2)click the "Add Hardware",and click "usb Host device"
3)click "cancel"
4)unplug usb A and insert usb B and repeat step2,you will find that usbA is there instead of usbB
If you insert usb A,then unplug it and insert usb B,and try to add it,you will find that usb B is there,even if you unplug it,and insert usb A.

Comment 5 Cole Robinson 2017-03-02 18:46:13 UTC
Thanks for the report, I can reproduce.

The issue is that while the both USB devices end up with the same libvirt nodedev name. This name is just a convenience identifier, which for usb devices is the string usb_$bus_$port

F25 virt-manager checks nodedev uniqueness by this name field, and only refreshes the list occasionally, like when launching the addhardware wizard. What happens is, the two different devices end up with the same nodedev name, we refresh the device list but since no names changed, we don't notice the new device, and advertise the old device data.

Upstream virt-manager with f25 libvirt actually doesn't have this problem, because we use the new libvirt nodedev event APIs, which asynchronously informs us when devices are added/removed, so we don't depend on name uniqueness. So the next release will 'fix' this. The old issue will still persist but IMO it's not worth the effort to fix in that case, since over time it will be less important.

Setting to POST since this is fixed in git

Comment 6 Fedora Update System 2017-03-14 18:40:16 UTC
virt-manager-1.4.1-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8b8b4e1753

Comment 7 Fedora Update System 2017-03-15 19:58:13 UTC
virt-manager-1.4.1-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8b8b4e1753

Comment 8 Fedora Update System 2017-03-17 18:51:20 UTC
virt-manager-1.4.1-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.