From nobody Mon Feb 9 17:07:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666621095; cv=none; d=zohomail.com; s=zohoarc; b=BMPPzebjR0xNGgWvEnTpDqtNCNWetARDdh+HjNmNmUMXn7x4lLJp/lwl4DN6+nz4nwVF7mNSMRgsuBxL0QWaIXh9aqUyt8hma2PsHyzA0mKgJP4HlZ5SDwg/mfQQ4BGENMpvDelQvUKOa3H5GuJVitZWRy75WQhofCRps8rwXfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666621095; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8UXLPMdvZEivFdet5giVUi5YZebBqla72hb5/ecwt6M=; b=RdJ3mDSaoLRGW0pjqGAq4a5xnFelZxtJJB3mGnD756a52rNq6I5FxdS9pgTvBLxrdbqscw9yKJd/ekhKQ8pPf/pqMRIGNJDandIBbD5Kxv9zWalizNDlem2hAe0nUEs6jSD54iuyDzPaPjc2pBM4LaqyhhuvWVi2gvZkdQXyF4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1666621095639971.4416433864989; Mon, 24 Oct 2022 07:18:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-wf2QgSZ3MYqtjmg5Xxq0jw-1; Mon, 24 Oct 2022 10:16:22 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81BAE185A794; Mon, 24 Oct 2022 14:15:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EA93492CA2; Mon, 24 Oct 2022 14:15:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6235B1946595; Mon, 24 Oct 2022 14:15:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8A885194658F for ; Mon, 24 Oct 2022 14:15:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 819B940C2064; Mon, 24 Oct 2022 14:15:22 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-27.brq.redhat.com [10.40.208.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id F000440C2140 for ; Mon, 24 Oct 2022 14:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666621094; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8UXLPMdvZEivFdet5giVUi5YZebBqla72hb5/ecwt6M=; b=B8e177WIig4geHh78Yeee6y54tMxMWFatT3VQZ1gzFf2pB4ZSSjC7+7U2DwqVLG9xaztHn S7EKe1p/oLAoLKCWWZGN2RuUynUS0owS+dYqdxoxgRKCol6U878NZ2IfC3JBotgJJghpUH 0gXU83rjYQ/3NTsrvZOgPhwAEQ5tL3o= X-MC-Unique: wf2QgSZ3MYqtjmg5Xxq0jw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/43] virNodeDevCapsDefParseHexId: Use 'virXPathUIntBase' Date: Mon, 24 Oct 2022 16:14:25 +0200 Message-Id: <51c6436527a78bdd95a0f5ba60f7b4a6a4627386.1666619795.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666621097308100005 Content-Type: text/plain; charset="utf-8" Switch to the proper function for parsing integer variant of a hex number via XPath and spell out properly that the argument is 'unsigned int'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/node_device_conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 9d04c5fdf4..ccedf77443 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -1808,15 +1808,14 @@ virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPt= r ctxt, static int virNodeDevCapsDefParseHexId(const char *xpath, xmlXPathContextPtr ctxt, - unsigned *value, + unsigned int *value, virNodeDeviceDef *def, const char *missing_error_fmt, const char *invalid_error_fmt) { int ret; - unsigned long val; - ret =3D virXPathULongHex(xpath, ctxt, &val); + ret =3D virXPathUIntBase(xpath, ctxt, 16, value); if (ret < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, ret =3D=3D -1 ? missing_error_fmt : invalid_error_f= mt, @@ -1824,7 +1823,6 @@ virNodeDevCapsDefParseHexId(const char *xpath, return -1; } - *value =3D val; return 0; } --=20 2.37.3