[libvirt] [PATCH] node_device: udev: Use base 16 for product/vendor
Daniel P. Berrange
berrange at redhat.com
Tue Jan 12 20:43:49 UTC 2010
On Tue, Jan 12, 2010 at 03:26:27PM -0500, Cole Robinson wrote:
> 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.
>
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
> src/node_device/node_device_udev.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
> index 7a9c1e5..55cfee2 100644
> --- a/src/node_device/node_device_udev.c
> +++ b/src/node_device/node_device_udev.c
> @@ -457,14 +457,14 @@ static int udevProcessPCI(struct udev_device *device,
> 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;
> }
>
> @@ -522,7 +522,7 @@ static int udevProcessUSBDevice(struct udev_device *device,
> if (udevGetUintProperty(device,
> "ID_MODEL_ID",
> &data->usb_dev.product,
> - 0) == PROPERTY_ERROR) {
> + 16) == PROPERTY_ERROR) {
> goto out;
> }
ACK
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list