Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 8900b49

Browse files
committed
Don't copy USB bus/address by default from node device
Putting vendor+product AND bus+addr in the XML is only needed if the user has duplicate USB devices attached to the machine. If we always pass bus + addr, then we've regressed for the vast majority of users who don't care about duplicate devices.
1 parent 6350566 commit 8900b49

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tests/nodedev-xml/devxml/usbdev1.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
<source>
33
<vendor id='0x0781'/>
44
<product id='0x5151'/>
5-
<address bus='1' device='4'/>
65
</source>
76
</hostdev>

virtinst/VirtualHostDevice.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ def _set_from_nodedev(self, nodedev):
214214

215215
self.vendor = nodedev.vendor_id
216216
self.product = nodedev.product_id
217-
self.bus = nodedev.bus
218-
self.device = nodedev.device
217+
218+
if not (self.vendor or self.product):
219+
self.bus = nodedev.bus
220+
self.device = nodedev.device
219221

220222
def _get_source_xml(self):
221223
xml = ""

0 commit comments

Comments
 (0)