From nobody Mon Sep 16 19:52:51 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1706635680960444.99682096618085; Tue, 30 Jan 2024 09:28:00 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id D750A1EB7; Tue, 30 Jan 2024 12:27:59 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2B07B1D47; Tue, 30 Jan 2024 12:09:59 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 990081CF6; Tue, 30 Jan 2024 12:09:27 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A378F1CF6 for ; Tue, 30 Jan 2024 12:08:26 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-VyYUx-81PeKM9BsnKcAf5g-1; Tue, 30 Jan 2024 12:08:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6C3F83538F for ; Tue, 30 Jan 2024 17:08:23 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E8CA2166B31 for ; Tue, 30 Jan 2024 17:08:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: VyYUx-81PeKM9BsnKcAf5g-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 13/31] virPCIVPDResourceGetKeywordPrefix: Fix logging Date: Tue, 30 Jan 2024 18:07:51 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: UFEGAEG5DTHOE72UJP4CITCAHFXF2V55 X-Message-ID-Hash: UFEGAEG5DTHOE72UJP4CITCAHFXF2V55 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706635682854100001 Use VIR_DEBUG instead of VIR_INFO as that's more appropriate and report relevant information for debugging. Signed-off-by: Peter Krempa --- src/util/virpcivpd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c index b303e161ae..67065dec46 100644 --- a/src/util/virpcivpd.c +++ b/src/util/virpcivpd.c @@ -61,20 +61,20 @@ virPCIVPDResourceGetKeywordPrefix(const char *keyword) g_autofree char *key =3D NULL; /* Keywords must have a length of 2 bytes. */ - if (strlen(keyword) !=3D 2) { - VIR_INFO("The keyword length is not 2 bytes: %s", keyword); - return NULL; - } else if (!(virPCIVPDResourceIsUpperOrNumber(keyword[0]) && - virPCIVPDResourceIsUpperOrNumber(keyword[1]))) { - VIR_INFO("The keyword is not comprised only of uppercase ASCII let= ters or digits"); - return NULL; - } + if (strlen(keyword) !=3D 2 || + !(virPCIVPDResourceIsUpperOrNumber(keyword[0]) && + virPCIVPDResourceIsUpperOrNumber(keyword[1]))) + goto cleanup; + /* Special-case the system-specific keywords since they share the "Y" = prefix with "YA". */ if (virPCIVPDResourceIsSystemKeyword(keyword) || virPCIVPDResourceIsVe= ndorKeyword(keyword)) key =3D g_strndup(keyword, 1); else key =3D g_strndup(keyword, 2); + cleanup: + VIR_DEBUG("keyword=3D'%s' key=3D'%s'", keyword, NULLSTR(key)); + return g_steal_pointer(&key); } --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org