From nobody Thu May 2 11:42:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501232777324861.2934764900023; Fri, 28 Jul 2017 02:06:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7B3C6D704; Fri, 28 Jul 2017 09:06:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A7DF6C43D; Fri, 28 Jul 2017 09:06:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1A60F4BB79; Fri, 28 Jul 2017 09:06:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6S96AZE030990 for ; Fri, 28 Jul 2017 05:06:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC0EE5D9C9; Fri, 28 Jul 2017 09:06:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B51FA5D969 for ; Fri, 28 Jul 2017 09:06:08 +0000 (UTC) Received: from m15-114.126.com (m15-114.126.com [220.181.15.114]) by mx1.redhat.com (Postfix) with ESMTP id 17E2DC0CD053 for ; Fri, 28 Jul 2017 09:06:05 +0000 (UTC) Received: from localhost.localdomain.localdomain (unknown [58.213.111.46]) by smtp7 (Coremail) with SMTP id DsmowADH569b93pZI6F0MQ--.34606S2; Fri, 28 Jul 2017 16:35:49 +0800 (CST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C7B3C6D704 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=126.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C7B3C6D704 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (1024-bit key) header.d=126.com header.i=@126.com header.b="cxyvQxNP" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 17E2DC0CD053 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=chen_han_xiao@126.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 17E2DC0CD053 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=0sSmKgeNGGxwJDcV04 6EEAMjtXvvA2YLGHfbRLrMl1M=; b=cxyvQxNPMQqIYFaWHuxBoQXptOgpYirW6P Fcdk/skri5zwuayjILuR+iru1rp0gjcaHQNbCzZJ1ukQ5eslIwp4XJptsWDYWDqB BRSqHpJ/raMDfRGF9GHlbIyGyb68Vx5CuDWTvq6mezLMCF4voOPWKVDdXvnynZxx PjT6yh2ko= From: Chen Hanxiao To: libvir-list@redhat.com Date: Fri, 28 Jul 2017 16:33:17 +0800 Message-Id: <1501230797-16685-1-git-send-email-chen_han_xiao@126.com> X-CM-TRANSID: DsmowADH569b93pZI6F0MQ--.34606S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uFWxtFy3GrWUuFyUGr4UJwb_yoW8Ww1rpF 98KFWIy395Kr43Gr9Fqa4rtFyUCwn8Way8tr1qg34UKr1kurZ3ta4Sk34UX397trWxJayr ArWDG34xZF4kJaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jUZ2-UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbi4wUjrlUw7AfjVQAAsT X-Greylist: Delayed for 00:30:13 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 28 Jul 2017 09:06:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 28 Jul 2017 09:06:07 +0000 (UTC) for IP:'220.181.15.114' DOMAIN:'m15-114.126.com' HELO:'m15-114.126.com' FROM:'chen_han_xiao@126.com' RCPT:'' X-RedHat-Spam-Score: 1.899 * (DCC_REPUT_13_19, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_PSBL, RP_MATCHES_RCVD, SPF_PASS) 220.181.15.114 m15-114.126.com 220.181.15.114 m15-114.126.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Chen Hanxiao Subject: [libvirt] [PATCH] hostdev: display leading zeros of USB vendor/product id's in error messages X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 28 Jul 2017 09:06:14 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Chen Hanxiao Many vendor id's and product id's have leading zeros. Show them in error messages. Signed-off-by: Chen Hanxiao --- src/util/virhostdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 579563c..0e6b5a3 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -1390,7 +1390,7 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostde= v, } else if (!autoAddress) { goto out; } else { - VIR_INFO("USB device %x:%x could not be found at previous" + VIR_INFO("USB device %04x:%04x could not be found at previous" " address (bus:%u device:%u)", vendor, product, bus, device); } @@ -1418,12 +1418,12 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr host= dev, } else if (rc > 1) { if (autoAddress) { virReportError(VIR_ERR_OPERATION_FAILED, - _("Multiple USB devices for %x:%x were foun= d," + _("Multiple USB devices for %04x:%04x were = found," " but none of them is at bus:%u device:%u= "), vendor, product, bus, device); } else { virReportError(VIR_ERR_OPERATION_FAILED, - _("Multiple USB devices for %x:%x, " + _("Multiple USB devices for %04x:%04x, " "use
to specify one"), vendor, product); } @@ -1435,7 +1435,7 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostde= v, usbsrc->autoAddress =3D true; =20 if (autoAddress) { - VIR_INFO("USB device %x:%x found at bus:%u device:%u (moved" + VIR_INFO("USB device %04x:%04x found at bus:%u device:%u (move= d" " from bus:%u device:%u)", vendor, product, usbsrc->bus, usbsrc->device, --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list