]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: display leading zeros of USB vendor/product id's in log messages
authorChen Hanxiao <chenhanxiao@gmail.com>
Fri, 19 May 2017 07:17:32 +0000 (15:17 +0800)
committerLaine Stump <laine@laine.org>
Wed, 24 May 2017 16:23:59 +0000 (12:23 -0400)
Many vendor id's and product id's have leading zeros.  We should show
them in the logs.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: Laine Stump <laine@laine.org>
src/util/virusb.c

index 8cd2f57f493afe05eed643017f6b7f13407d6b5a..6359235ff9a86f2e351bdf751a6c90a62e9a6788 100644 (file)
@@ -221,7 +221,7 @@ virUSBDeviceFindByVendor(unsigned int vendor,
     if (list->count == 0) {
         virObjectUnref(list);
         if (!mandatory) {
-            VIR_DEBUG("Did not find USB device %x:%x",
+            VIR_DEBUG("Did not find USB device %04x:%04x",
                       vendor, product);
             if (devices)
                 *devices = NULL;
@@ -229,7 +229,7 @@ virUSBDeviceFindByVendor(unsigned int vendor,
         }
 
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Did not find USB device %x:%x"), vendor, product);
+                       _("Did not find USB device %04x:%04x"), vendor, product);
         return -1;
     }
 
@@ -300,7 +300,7 @@ virUSBDeviceFind(unsigned int vendor,
     if (list->count == 0) {
         virObjectUnref(list);
         if (!mandatory) {
-            VIR_DEBUG("Did not find USB device %x:%x bus:%u device:%u",
+            VIR_DEBUG("Did not find USB device %04x:%04x bus:%u device:%u",
                       vendor, product, bus, devno);
             if (usb)
                 *usb = NULL;
@@ -308,7 +308,7 @@ virUSBDeviceFind(unsigned int vendor,
         }
 
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Did not find USB device %x:%x bus:%u device:%u"),
+                       _("Did not find USB device %04x:%04x bus:%u device:%u"),
                        vendor, product, bus, devno);
         return -1;
     }