From nobody Tue Feb 10 01:15:30 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=1666621018; cv=none; d=zohomail.com; s=zohoarc; b=dYhXZah+xbN7hrjtlP4r59+VDGLFtJQdFmqZGi+VQjAh+zpRqeZ97rTf3fzE3Sm/1wkUP4mO0YwW/KT3a5b59ODCktrm+InjgGrPULZ1jtsvzVpKO9W88RTL/nQgwCAROvPxG9qzJ6DzLGPJyXtuSlH4IPJknr6Pll5TS+vZGpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666621018; 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=d13ebuApMhIX993nPA+VmBT6b8qDTZnVasgzKZ8Wm5A=; b=kl7vDKP+hgigQV1/IwYdrl/fVQ65oWfymyrLqXf1ryVcrVU/Xei18txMdpq/YaiRW3d2cpc3aeckS8gLreZOywV7BxYD3lroc47JHrrffgSCp8cgOtm5/WWYJLhjKBAP/t9YCr2tGV0ZwZT/aCGPveOKzVZZ/8CSwLwxuG1Q6Z4= 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 1666621018850691.8887993080324; Mon, 24 Oct 2022 07:16:58 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-536-iLF_LHIEN9Cy-xtAC7q9xg-1; Mon, 24 Oct 2022 10:16:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B37861C0A115; Mon, 24 Oct 2022 14:15:55 +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 9FA91492B0A; Mon, 24 Oct 2022 14:15:55 +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 81E1A194658F; Mon, 24 Oct 2022 14:15:55 +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 D3E2A194658D for ; Mon, 24 Oct 2022 14:15:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C9CD540C2064; Mon, 24 Oct 2022 14:15:53 +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 1BCBE40C2088 for ; Mon, 24 Oct 2022 14:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666621017; 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=d13ebuApMhIX993nPA+VmBT6b8qDTZnVasgzKZ8Wm5A=; b=UenLadd9irrYD7In0gCWzP0u0xv7cEuf6BIQfpTYMc4w4BEBQBgyOekOaD4qFIveL4EUxX 01HYQhBcfnVIVUJvDMs42onnI3IgOFMIf1rI47TFiuubqfrd3Ov3LD4a7ZSRVIKKWIK02l X4GNr8CXNRiXoXvGgUUF22rUG8qJWnY= X-MC-Unique: iLF_LHIEN9Cy-xtAC7q9xg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 39/43] ppc64ModelParse: Switch to virXMLPropUInt from virXPathULongHex Date: Mon, 24 Oct 2022 16:14:44 +0200 Message-Id: <586833bb8cc303bab29b8ec606e22caff94ecf48.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.10 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: 1666621020889100001 Content-Type: text/plain; charset="utf-8" We don't need to do the extra XPath lookups and we can use the proper type right away. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 7da67ec94a..30db99cca1 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -305,7 +305,6 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, g_autoptr(virCPUppc64Model) model =3D NULL; g_autofree xmlNodePtr *nodes =3D NULL; g_autofree char *vendor =3D NULL; - unsigned long pvr; size_t i; int n; @@ -346,23 +345,13 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, model->data.len =3D n; for (i =3D 0; i < n; i++) { - ctxt->node =3D nodes[i]; - - if (virXPathULongHex("string(./@value)", ctxt, &pvr) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or invalid PVR value in CPU model %s= "), - model->name); + if (virXMLPropUInt(nodes[i], "value", 16, VIR_XML_PROP_REQUIRED, + &model->data.pvr[i].value) < 0) return -1; - } - model->data.pvr[i].value =3D pvr; - if (virXPathULongHex("string(./@mask)", ctxt, &pvr) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or invalid PVR mask in CPU model %s"= ), - model->name); + if (virXMLPropUInt(nodes[i], "mask", 16, VIR_XML_PROP_REQUIRED, + &model->data.pvr[i].mask) < 0) return -1; - } - model->data.pvr[i].mask =3D pvr; } VIR_APPEND_ELEMENT(map->models, map->nmodels, model); --=20 2.37.3