udev doesn't prefix USB product/vendor info with '0x', so the
strtol conversions were wrong for the product field (vendor already
set the correct base). Make the change for PCI product/vendor as
well to be safe.
This fixes USB device assignment via virt-manager.
if (udevGetUintSysfsAttr(device,
"vendor",
&data->pci_dev.vendor,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}
if (udevGetUintSysfsAttr(device,
"device",
&data->pci_dev.product,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}
if (udevGetUintProperty(device,
"ID_MODEL_ID",
&data->usb_dev.product,
- 0) == PROPERTY_ERROR) {
+ 16) == PROPERTY_ERROR) {
goto out;
}