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

Commit 6350566

Browse files
committed
Fix test failures from USB addr changes
1 parent a58a7fd commit 6350566

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tests/nodedev-xml/devxml/usbdev1.xml

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

virtinst/VirtualHostDevice.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,19 @@ def _set_from_nodedev(self, nodedev):
219219

220220
def _get_source_xml(self):
221221
xml = ""
222+
found = False
223+
222224
if self.vendor and self.product:
223225
xml += " <vendor id='%s'/>\n" % self.vendor
224226
xml += " <product id='%s'/>\n" % self.product
227+
found = True
228+
225229
if self.bus and self.device:
226230
xml += " <address bus='%s' device='%s'/>\n" % (self.bus,
227231
self.device)
228-
else:
232+
found = True
233+
234+
if not found:
229235
raise RuntimeError(_("'vendor' and 'product', or 'bus' and "
230236
" 'device' are required."))
231237
return xml

0 commit comments

Comments
 (0)