Re: [libvirt] [PATCH] udev: Don't let strtoul parse USB busnum and devnum as octal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/02/2010 03:52 AM, Matthias Bolte wrote:
2010/2/2 Dave Allan<dallan@xxxxxxxxxx>:
On 02/01/2010 06:10 PM, Matthias Bolte wrote:

udevGetUintProperty was called with base set to 0 for busnum and devnum.
With base 0 strtoul parses the number as octal if it start with a 0. But
busnum and devnum are decimal and udev returns them padded with leading
zeros. So strtoul parses them as octal. This works for certain decimal
values like 001-007, but fails for values like 008.

This is a good change, but I thought it was already fixed a couple of weeks
ago.  You're sure they're returned decimal and not hex?  ACK assuming that's
the case.


vendor, device and ID_MODEL_ID where changed to be parsed as hex some weeks ago.

I based my assumption that busnum and devnum are decimal on the lsusb
manpage, because the udev driver output matches the lsusb output. The
manpage says busnum and devnum are decimal and it also says that
vendor is hex.

I just found a libvirt bugreport [1] that confirms my assumption. Also
googling for 'lsusb "bus X"' with X as decimal and hex numbers gives
no result with hex numbers like 00A, but gives results for decimal
numbers like 010, 011, etc. So I'm pretty sure that busnum and devnum
are decimal :)

Excellent--many thanks!

Dave

Okay, I pushed this one.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=508645

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]