From nobody Sun Feb 8 11:54:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; 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 8.43.85.245 as permitted sender) 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 1726061913581786.0578661959632; Wed, 11 Sep 2024 06:38:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 895C31523; Wed, 11 Sep 2024 09:38:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4C6481884; Wed, 11 Sep 2024 09:38:03 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4FD2214FF; Wed, 11 Sep 2024 09:37:58 -0400 (EDT) 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 D4D0C14F8 for ; Wed, 11 Sep 2024 09:37:57 -0400 (EDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-FzsZAobLMce6gJr-UhIRSg-1; Wed, 11 Sep 2024 09:37:56 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42cb2c9027dso16661195e9.1 for ; Wed, 11 Sep 2024 06:37:56 -0700 (PDT) Received: from jpalacky-thinkpadt14sgen2i.tpb.csb (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb8ae9csm141343275e9.42.2024.09.11.06.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 06:37:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726061877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zTIn7roDyz4/3EPcUMwZ/+yfZNoT0QMxTdmeENlw7S8=; b=Vj3Tnd7oEV2vQcr3k0qateqFZW73O6Qzfx5zqWbacrEFhIvkN84zd3s71lD47uZix1UX61 v79hPRjxZqvslWaU1XqVN7+de4ida1T+gT4Ev7Hch/zLAnMuDnctKjpo64Kw/qIy0aAupf +8ncaYZ2mnNRBEaExgVkm0HVM7MAeFk= X-MC-Unique: FzsZAobLMce6gJr-UhIRSg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726061875; x=1726666675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zTIn7roDyz4/3EPcUMwZ/+yfZNoT0QMxTdmeENlw7S8=; b=T8rYa+JylWWG9HAACTemFnSHYd6yFRV52N3Zd32EzG45SQA8qdFnmGTwhCwup4dxmS VJPDzy0eDXDNOMtIvPG6iAx3Gnk4h4sPd1p2cecrNgrNBJtoeFXWFnGV4V4e2KWl8k30 B6POFYFAASkO/thHlzIAvV6uRQREh3r8Gf1cd0dbEb+LjaMZKF5qhAw3VxAjyPfhtHBO hJr2cT+xRURIeva/T+c9R+hg8Z9qn0BK7h24m6EGsnuV+Bf2yR7DEf7sZ3ZDeKe1VN3Y gukWbcEYYOd1aW6JO3vA9nxqgEEeIUvYlgKCfa2mnjddHJGtSswypXsVADbNnz3S/1yQ ODCQ== X-Gm-Message-State: AOJu0YzeTLNOn/yOCqgkR1SL1Y6uRdp7khrGbI/SGcKNModuv4peCrfO zLADj6FLukhHKRfT4crDKUDsldLkpgpJRFuBat21KvBgUTVs6lX+SC9b13phKoq/s4aCQBM8q1o FfgFoi2M3Dn80f5nZ1la6vZtduYOyAzr+QfA2zZ8Eu9z1lghQvlJioRg682arP+cuekp2dPLHg7 38od9RvuoP9FqlB4oN73mSrakl+utCux0ct/Lis2I= X-Received: by 2002:a05:600c:3ba6:b0:426:61e8:fb3b with SMTP id 5b1f17b1804b1-42ccd35b205mr23740515e9.27.1726061875150; Wed, 11 Sep 2024 06:37:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG36IcNQPHxeAEt8N2rqfcofY+Mip+0yWBkOzL6KpUwpVDjNWnvtHssKC8mvOxCUnHRCOAlPQ== X-Received: by 2002:a05:600c:3ba6:b0:426:61e8:fb3b with SMTP id 5b1f17b1804b1-42ccd35b205mr23740275e9.27.1726061874594; Wed, 11 Sep 2024 06:37:54 -0700 (PDT) From: Jakub Palacky To: devel@lists.libvirt.org Subject: [PATCH 1/2] util/virxml: use xmlCtxtGetLastError when applicable Date: Wed, 11 Sep 2024 15:37:41 +0200 Message-ID: <20240911133742.376422-2-jpalacky@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240911133742.376422-1-jpalacky@redhat.com> References: <20240911133742.376422-1-jpalacky@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QWXXNDGYCZNQQM4D4VULJE7Y2E2SSZMN X-Message-ID-Hash: QWXXNDGYCZNQQM4D4VULJE7Y2E2SSZMN X-MailFrom: jpalacky@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 CC: Jakub Palacky 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726061915682116600 Content-Type: text/plain; charset="utf-8"; x-default="true" xmlParserCtxt->lastError was deprecated in libxml2 v2.13.0-103-g1228b4e0 xmlCtxtGetLastError(xmlParserCtxt) should be used instead Signed-off-by: Jakub Palacky --- src/util/virxml.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index a7b75fd7b3..b72b63f55f 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1035,8 +1035,8 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSE= D, ...) if (!ctxt || (virGetLastErrorCode()) || ctxt->input =3D=3D NULL || - ctxt->lastError.level !=3D XML_ERR_FATAL || - ctxt->lastError.message =3D=3D NULL) + xmlCtxtGetLastError(ctxt)->level !=3D XML_ERR_FATAL || + xmlCtxtGetLastError(ctxt)->message =3D=3D NULL) return; =20 if (ctxt->_private) @@ -1078,19 +1078,19 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNU= SED, ...) =20 pointerstr =3D virBufferContentAndReset(&buf); =20 - if (ctxt->lastError.file) { + if (xmlCtxtGetLastError(ctxt)->file) { virGenericReportError(domcode, VIR_ERR_XML_DETAIL, _("%1$s:%2$d: %3$s%4$s\n%5$s"), - ctxt->lastError.file, - ctxt->lastError.line, - ctxt->lastError.message, + xmlCtxtGetLastError(ctxt)->file, + xmlCtxtGetLastError(ctxt)->line, + xmlCtxtGetLastError(ctxt)->message, contextstr, pointerstr); } else { virGenericReportError(domcode, VIR_ERR_XML_DETAIL, _("at line %1$d: %2$s%3$s\n%4$s"), - ctxt->lastError.line, - ctxt->lastError.message, + xmlCtxtGetLastError(ctxt)->line, + xmlCtxtGetLastError(ctxt)->message, contextstr, pointerstr); } --=20 2.46.0