From nobody Sun Feb 8 22:07:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1666621028; cv=none; d=zohomail.com; s=zohoarc; b=fh2W/oGy9S26CIQLNP/lLdzD3BbTCLMSSjAYvjITqTAc1u+djwDt6ti0VFeXkxYzTX9TYh314+rxGrrsxyEbOGzd+hxKECHWW34f5FEHagxdrmuzOmPIlThUVfvzqYXcpsG8gbk7CyH4gtJWzlW2jmqZuvao8+MClvgsHEpxRuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666621028; 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=4J/NhLeUtRBYh+LV2iodQ5Ihjb/ZWSzxytKRDBWAa6k=; b=gqrN9hRH0lZEYn/doJXAytFwF1ldKtlJ9KRGAbtTDFnV9E3viOoFlChFWmu/k3QGCLMyF3U4Myra1ScH+H6eXq5oAVafO5m20GouqQKfXxKOrfUzYDyJksR2P7RT6lYjLs5BO/XZdZcmsWOFMmxjZntbVpuUJ+r/1JKimv44UGs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1666621028740765.293884131592; Mon, 24 Oct 2022 07:17:08 -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-474-Mfu8cNXqMgeCr__PQnonmw-1; Mon, 24 Oct 2022 10:16:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCE45811E84; Mon, 24 Oct 2022 14:16:01 +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 A8BB835429; Mon, 24 Oct 2022 14:16:01 +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 959311946595; Mon, 24 Oct 2022 14:16:01 +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 D0B2A194658D for ; Mon, 24 Oct 2022 14:15:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C31CE40C2064; Mon, 24 Oct 2022 14:15:59 +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 1C7EF40C2140 for ; Mon, 24 Oct 2022 14:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666621027; 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=4J/NhLeUtRBYh+LV2iodQ5Ihjb/ZWSzxytKRDBWAa6k=; b=IiTDnbRCKtYcHu2NLkKU+DDFL9sifdVbRetprX+mghlF0JUBZe3bjFkjo+kGAivo0POBQV ekQCT0PXW1bNqmkkZh/ekGdgjYIhpV3WFb85Hnnr4vBlHdzZ+4yDi4XxwC91QwD1rB8VtZ u+w5Grwkp4dhgaE3vM8oiPUGqdRwFZE= X-MC-Unique: Mfu8cNXqMgeCr__PQnonmw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 43/43] util: xml: Remove unused virXPathULong* Date: Mon, 24 Oct 2022 16:14:48 +0200 Message-Id: <8ce3a63f560dd111dbfce299af74563b31e8991a.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.5 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: 1666621031000100001 Content-Type: text/plain; charset="utf-8" Remove the now-unused functions for parsing 'unsigned long' values via XPath. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 2 -- src/util/virxml.c | 75 ---------------------------------------- src/util/virxml.h | 8 ----- 3 files changed, 85 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0fc5481a26..5bc58d9281 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3699,8 +3699,6 @@ virXPathNodeSet; virXPathString; virXPathUInt; virXPathUIntBase; -virXPathULong; -virXPathULongHex; virXPathULongLong; virXPathULongLongBase; diff --git a/src/util/virxml.c b/src/util/virxml.c index f5ee9284a6..ca83ea1dd5 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -142,38 +142,6 @@ virXPathInt(const char *xpath, } -static int -virXPathULongBase(const char *xpath, - xmlXPathContextPtr ctxt, - int base, - unsigned long *value) -{ - g_autoptr(xmlXPathObject) obj =3D NULL; - int ret =3D 0; - - if ((ctxt =3D=3D NULL) || (xpath =3D=3D NULL) || (value =3D=3D NULL)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Invalid parameter to virXPathULong()")); - return -1; - } - obj =3D xmlXPathEval(BAD_CAST xpath, ctxt); - if ((obj !=3D NULL) && (obj->type =3D=3D XPATH_STRING) && - (obj->stringval !=3D NULL) && (obj->stringval[0] !=3D 0)) { - if (virStrToLong_ul((char *) obj->stringval, NULL, base, value) < = 0) - ret =3D -2; - } else if ((obj !=3D NULL) && (obj->type =3D=3D XPATH_NUMBER) && - (!(isnan(obj->floatval)))) { - *value =3D (unsigned long) obj->floatval; - if (*value !=3D obj->floatval) - ret =3D -2; - } else { - ret =3D -1; - } - - return ret; -} - - /** * virXPathUIntBase: * @xpath: the XPath string to evaluate @@ -216,49 +184,6 @@ virXPathUInt(const char *xpath, } -/** - * virXPathULong: - * @xpath: the XPath string to evaluate - * @ctxt: an XPath context - * @value: the returned long value - * - * Convenience function to evaluate an XPath number - * - * Returns 0 in case of success in which case @value is set, - * or -1 if the XPath evaluation failed or -2 if the - * value doesn't have a long format. - */ -int -virXPathULong(const char *xpath, - xmlXPathContextPtr ctxt, - unsigned long *value) -{ - return virXPathULongBase(xpath, ctxt, 10, value); -} - - -/** - * virXPathUHex: - * @xpath: the XPath string to evaluate - * @ctxt: an XPath context - * @value: the returned long value - * - * Convenience function to evaluate an XPath number - * according to base of 16 - * - * Returns 0 in case of success in which case @value is set, - * or -1 if the XPath evaluation failed or -2 if the - * value doesn't have a long format. - */ -int -virXPathULongHex(const char *xpath, - xmlXPathContextPtr ctxt, - unsigned long *value) -{ - return virXPathULongBase(xpath, ctxt, 16, value); -} - - /** * virXPathULongLongBase: * @xpath: the XPath string to evaluate diff --git a/src/util/virxml.h b/src/util/virxml.h index 439a2a9991..f19cbe59ae 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -60,10 +60,6 @@ virXPathUInt(const char *xpath, xmlXPathContextPtr ctxt, unsigned int *value); int -virXPathULong(const char *xpath, - xmlXPathContextPtr ctxt, - unsigned long *value); -int virXPathULongLongBase(const char *xpath, xmlXPathContextPtr ctxt, unsigned int base, @@ -76,10 +72,6 @@ int virXPathLongLong(const char *xpath, xmlXPathContextPtr ctxt, long long *value); -int -virXPathULongHex(const char *xpath, - xmlXPathContextPtr ctxt, - unsigned long *value); xmlNodePtr virXPathNode(const char *xpath, xmlXPathContextPtr ctxt); --=20 2.37.3