<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.FoxDiv20201208220615346255 { }body { font-size: 14px; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Yes, I checked the libvirt code and found that the strtoul function is used to do the hexadecimal conversion, thank you for your reply :)</div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>yaohua.wu@zstack.io</div></div></span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From£º</b> <a href="mailto:yaohua.wu@zstack.io">YaoHua Wu</a></div><div><b>Date£º</b> 2020-12-08 16:14</div><div><b>To£º</b> <a href="mailto:libvirt-users@redhat.com">libvirt-users</a></div><div><b>Subject£º</b> Cannot passthrough usb with bus number and device number</div></div></div><div><div class="FoxDiv20201208220615346255">
<div><span></span>Sometimes, qemu cannot find correct usb device number</div><div>Reproduce steps:</div><div>1¡¢lsusb</div><div>Bus 001 Device 011: ID 090c:<span style="line-height: 1.5; background-color: transparent;">1000</span></div><div>1¡¢prepare usb device attach xml</div><div><hostdev managed="yes" mode="subsystem" type="usb"></div><div><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><source></div><div><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="line-height: 1.5; background-color: transparent;"><vendor id="0x090c" /></span></div><div><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="line-height: 1.5; background-color: transparent;"><product id="0x1000" /></span></div><div><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span><span style="line-height: 1.5; background-color: transparent;"><</span><span style="line-height: 1.5; background-color: transparent;">address bus='001' device='011'/></span></div><div><span style="color: rgb(0, 0, 0); line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    </span></source><address bus="1" port="1" type="usb" /></div><div></hostdev></div>
<div>2¡¢virsh attach-device vm usb.xml</div><div>error: internal error: Did not find USB device 090c:1000 bus:1 device 9</div><div><br></div><div>Question:</div><div>why the device number returned in qemu's error report is not what I wrote in xml£¬</div><div>what I mean is that if my dev number is really wrong, the returned error should also be the number I wrote£¬</div><div>commonly when using dongle</div><div><br></div><div>Look forward to your reply</div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>yaohua.wu</div></div></span></div>
</div></div></blockquote>
</body></html>