[libvirt] [Klaus@Ethgen.de: [Pkg-libvirt-maintainers] Bug#579208: USB Class/Number/... is base 16, not base 10 (Failed to convert 'ff' to unsigned int)]

Hi, this patch from Klau Ethgen looks right to me. O.k. to apply? I'll remove the comment with this patch then. Cheers, -- Guido ----- Forwarded message from Klaus Ethgen <Klaus@Ethgen.de> ----- in node_device_udev.c is the base 10 used for conversion of USB values. But they are hex values so that the conversion fail in the most of time. Funny is that the upstream did know that but didn't fix it (comment in line 551). The patch will fix that. But it do not remove the comment. --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -559,28 +559,28 @@ static int udevProcessUSBInterface(struc if (udevGetUintSysfsAttr(device, "bInterfaceNumber", &data->usb_if.number, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) { goto out; } if (udevGetUintSysfsAttr(device, "bInterfaceClass", &data->usb_if._class, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) { goto out; } if (udevGetUintSysfsAttr(device, "bInterfaceSubClass", &data->usb_if.subclass, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) { goto out; } if (udevGetUintSysfsAttr(device, "bInterfaceProtocol", &data->usb_if.protocol, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) { goto out; }

On 04/26/2010 11:11 AM, Guido Günther wrote:
Hi, this patch from Klau Ethgen looks right to me. O.k. to apply? I'll remove the comment with this patch then.
Is there documentation somewhere that mentions what base the udev strings are encoded in? At any rate, I agree with you that given the XXX comment, that this patch looks right.
if (udevGetUintSysfsAttr(device, "bInterfaceNumber", &data->usb_if.number, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) {
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Mon, Apr 26, 2010 at 11:26:51AM -0600, Eric Blake wrote:
On 04/26/2010 11:11 AM, Guido Günther wrote:
Hi, this patch from Klau Ethgen looks right to me. O.k. to apply? I'll remove the comment with this patch then.
Is there documentation somewhere that mentions what base the udev strings are encoded in? At any rate, I agree with you that given the XXX comment, that this patch looks right.
That's my comment in the code. I was uncertain at the time I wrote it what the correct base was. If you're certain that the correct base is 16, then ACK, and please do remove the comment. Dave
if (udevGetUintSysfsAttr(device, "bInterfaceNumber", &data->usb_if.number, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) {
ACK.
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, Am Mo den 26. Apr 2010 um 18:26 schrieb Eric Blake:
Is there documentation somewhere that mentions what base the udev strings are encoded in?
A short look to the code: drivers/usb/core/sysfs.c: usb_descriptor_attr(bDeviceClass, "%02x\n") usb_descriptor_attr(bDeviceSubClass, "%02x\n") usb_descriptor_attr(bDeviceProtocol, "%02x\n") usb_descriptor_attr(bNumConfigurations, "%d\n") usb_descriptor_attr(bMaxPacketSize0, "%d\n") So, yes, it is documented. :-) Regards Klaus Ethgen - -- Klaus Ethgen http://www.ethgen.de/ pub 2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de> Fingerprint: D7 67 71 C4 99 A6 D4 FE EA 40 30 57 3C 88 26 2B -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEVAwUBS9Yc85+OKpjRpO3lAQr8kAf/WhUYb7Opu0inoSG39Fx1oXa6p2P4s4CD FnHg5hZ0RyhE+gOkDKMC06GH/X19lEXEPpIAQIQKT9gmHTnyYBUvfouBrn945Oo5 CXA3hdbcquUkdK9VUPZy1rt97z4Y6Bhl5jpcq1qUmCWBX/5jjwBUbTGUczOuOrqd fqa40E7zZGiIz+UaQ0n2IDJvj4dP2Zna+WQdX6JbklNLXVH3vbtxZ9PwDh6ZBtrS 3Ufvl4TRTJzh3XGc3Z+nOqOorAtoacMTDbCly0WvjpGKU7hkZMNrZDKaFa2ub+ae KI1phuoHuDHPgbPBM2/uuhDuvZvRZ1knnF3VOLL7/fzDPIxi1FOJeA== =4+C/ -----END PGP SIGNATURE-----

On Mon, Apr 26, 2010 at 11:26:51AM -0600, Eric Blake wrote:
On 04/26/2010 11:11 AM, Guido Günther wrote:
Hi, this patch from Klau Ethgen looks right to me. O.k. to apply? I'll remove the comment with this patch then.
Is there documentation somewhere that mentions what base the udev strings are encoded in? At any rate, I agree with you that given the XXX comment, that this patch looks right. As Klaus pointed out the only docs seems to be the kernel source.
if (udevGetUintSysfsAttr(device, "bInterfaceNumber", &data->usb_if.number, - 10) == PROPERTY_ERROR) { + 16) == PROPERTY_ERROR) {
ACK. Pushed now. -- Guido
participants (4)
-
Dave Allan
-
Eric Blake
-
Guido Günther
-
Klaus Ethgen