From nobody Sat Oct 24 20:21:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=invisiblethingslab.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1792109568927219.53175064629136; Thu, 15 Oct 2026 17:12:48 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id DA82F4188D; Thu, 15 Oct 2026 20:12:46 -0400 (EDT) Received: from [172.19.199.16] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id D3FEC41B71; Thu, 15 Oct 2026 20:11:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 088FC3FCAD; Thu, 15 Oct 2026 20:11:30 -0400 (EDT) Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 34A3E3F320 for ; Thu, 15 Oct 2026 20:11:29 -0400 (EDT) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 0F1E31D0018D for ; Thu, 15 Oct 2026 20:05:42 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Thu, 15 Oct 2026 20:05:42 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Oct 2026 20:05:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Greylist: delayed 346 seconds by postgrey-1.37 at lists.libvirt.org; Thu, 15 Oct 2026 20:11:29 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1792109141; x=1792195541; bh=7BBwUyyBpAq76KdPmdHYjx/mGL8ewbWk nxsyuW5rPrc=; b=I/AiY+jFudOmLdPJAA0U888Z/Z0+xMNtVyLNm4941mFOQWQN fhi68TbSvRQDBtpoeqlRg1w4I9rHP96ertmnUkb5WKxsMxFvE1aw7nP8zRXMzUjI K7gUft//Zr1XPt4ruyKYfkfvdHTugC3f3BxpabQ7Jl/LYEZwLrdj9N5nCbUJmE7v lMittTmnOaYqdPylR9KkMztTcLSvvJrle743KT2vZLqmW4yNGiU8w0kp19twGSoY h/S6S/d4U6t7j3Emh0qFGTQto3s7AjlooEor7rdmTZ6drHkPyUlMAL5JJngwhqBt IJ2WdfiGCgswGlxq7FZC2tewwG9ylYpSjZbuMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1792109141; x=1792195541; bh=7BBwUyyBpAq76KdPmdHYjx/mGL8e wbWknxsyuW5rPrc=; b=OMfj2TzQuIOTVTBoebE+ELgU00Ct7ziL/aW4pP4gw2wY zK/Tk/SqzNDCIWl8w9vOuXmu9C5jQIgKRDTV9cHTvWVs1xoEo/lZ0jyA0bs9DZKa Txq3ae0akatA99bRjpoi0AScSDY+Onj9LjFzKlYMtw3IOSYScdD7zT5AQZKlJweW MJ8Ol5bbfZf8qRRY1PjjWVgQLbFMMGNMccpPuIqxYlgtU0X6TxXfVrwGY/4pQ/3D gA6X0vcnoAyPP3JJPA88czDx7Be2zSJ2fgxzg1IFCPSlEj98aBTxCeza6XhHCugc yHdkYjkwMHAEwOTAnS8MImKRtYr3FEthQFgH27k4jw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-08; sw=lmtpprox; action=sign d=invisiblethingslab.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1792109141; d=invisiblethingslab.com; mf=PG1hcm1hcmVrQGludmlzaWJsZXRoaW5nc2xhYi5jb20+; rt=PGRldmVsQGxpc3RzLmxpYnZpcnQub3JnPg==; s=fm2:rsa-sha256:QMKX7Wd+7vyHLCY6AdItLQS6Dl2T/CyD+PSB83p1xWJcyNT skHj/4eQS+CKCxgy5xA+sSQJx/1PV2ylAVhefpP2o7vreG7VzQwv028aMkWBHRyf Gp2mSt7OFNCERrDe8IX2dP7tGwcaPnH2IxYF6WFTTgYOrFop9lvb+C+6pYZ5xm26 DvWZV3r8x5FNQSvfEOdrYJgSxYBH8T2Zmnooh2aEBQwYGBoxMdwjYMbN9yspEJeX 6LZENYrDEBTy1m/rT29zKuIfXtVBZduyIXzXtxjMHYi8FV1nULErbRDIt+uu7NpR PxIFNMCFQVHl6r80X8AbGrdMzYE0MeY42atKulQ==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06; repo=github.com/dkim2wg/interop; date=2026-10-08; sw=lmtpprox; action=mi-m=1; hc=10; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,message-id,mime-version,subject,to; Message-Instance: m=1; h=sha256:VwcseYiLogD7r5MuM+2ClP1L1ReAyOexIBZ3s0kMSAE=:cK5Me0i58dSW59XSBqJtxiPGUhvSHcld7kOBrPQLPJg=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEPIw0kmkzVW+VLzdqWt6dDriYeoRVOtNwfNcTjHMMllsSkghdjWIKuYvPD5P1N/u AF3GTcjUwgSpegTGU8fjOmaDH7YwkJS4rSZL4toLEghBWAonIif5Twod02zCCl+9kcfyHf N98jCmtprjzyyRIBfUNA3Mil5ObtCltg5CZehCjPj9/Bzzivc1IebJnpNmOuYS5dWRyD4A xGmeXXt4IE9l+DH41JktSzaK48V4KUeU68AGvFMHUJlczqxHX8EF7qhxLsYOlr83wwT7dD pS/H5ISTDx3b61zju9EwD7rrsMDLNedIKYfJeGHc49bNonCxW3K7ePZHk59n4p8VFn9pLs Ian/fLe8YKTPsNJ4C13xkXHdTFWEAmzkLGZqNuZjjIrKKCHfQviY8qpHJI3Yxo5H5tRpVO b8t7+6Bm26AjV0j4P8SREHBnY8T15WvIjcOmkopWZLe1yRGoaudhsInM8vLsKrl4w9XbGW UteWIvIgvEvCmG5W9Td+cYaH4oMup5QVLAEi3B9j060gnwAyLyc/0o08P1Cuy86GY+JOIb zx41SvUHQxY3hA1Xyi/DAUTFeLfRqhGfJV68Z5wwOCr3oFdr5tu9RynPaFKWc0Q9Sx24De 7cD5pXdab//yX3WMtqUEQJKf4f8sKKFPOxKK/I4khfKubDMT9iHrUhGFlabg X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: devel@lists.libvirt.org Subject: [PATCH] virpci: fix handling newline in PCI device class Date: Fri, 16 Oct 2026 02:04:42 +0200 Message-ID: <20261016000528.412727-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2E5NJUIUJ3VGZIPA7WMON6WVK2XAJLDF X-Message-ID-Hash: 2E5NJUIUJ3VGZIPA7WMON6WVK2XAJLDF X-MailFrom: marmarek@invisiblethingslab.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1792109572390158500 The referenced commit removed trimming newline resulting in errors like: Unusual value in /sys/bus/pci//devices/0000:00:17.0/class: 0x010601 It's a perfectly valid class, it's just the newline that virStrToLong_ui didn't like (as it wasn't parsed and endptr is given NULL). Restore stripping newline, but do so a bit nicer than hardcoded offset. Fixes: 58b3a78aff "virPCIDeviceReadClass: Don't write beyond end of buffer = from virFileReadAll" Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Michal Privoznik --- src/util/virpci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virpci.c b/src/util/virpci.c index 34fc70e261..66500132c9 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -488,6 +488,8 @@ virPCIDeviceReadClass(virPCIDevice *dev, uint16_t *devi= ce_class) if (virFileReadAll(path, 9, &id_str) < 0) return -1; =20 + virStringTrimOptionalNewline(id_str); + if (virStrToLong_ui(id_str, NULL, 16, &value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unusual value in %1$s/devices/%2$s/class: %3$s"), --=20 2.54.0