From nobody Mon Dec 15 09:46:14 2025 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 1726141685972493.86591059423097; Thu, 12 Sep 2024 04:48:05 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D0F1F153F; Thu, 12 Sep 2024 07:48:04 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B488D139E; Thu, 12 Sep 2024 07:47:46 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 697851391; Thu, 12 Sep 2024 07:47:43 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 B8857137D for ; Thu, 12 Sep 2024 07:47:42 -0400 (EDT) Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-V8fIBKQ_NAmgWEXDPGfGRA-1; Thu, 12 Sep 2024 07:47:41 -0400 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5367cae7614so479818e87.3 for ; Thu, 12 Sep 2024 04:47:41 -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 ffacd0b85a97d-378956d3654sm14299595f8f.78.2024.09.12.04.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 04:47:37 -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=1726141662; 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=n9dDDrecIM1y8v3Vzp3bpAwQJvOV/wJaX6U1y5/yapQ=; b=ha1lCaUqhTJq/jj83kKR/Fqp1SaQF4GTeJvzvDu9PDo2+JZ/qgPrurvfIvqZEOXZqUbw69 UxmuRubAePOBR6Oddo2eDshRUxjVjO1GdA4wC7uKZ68fwbevSQSLYxD/PvjXgtq0el1as+ 09IsNZC07UFOveiNETeAIoWmp3Jy+PU= X-MC-Unique: V8fIBKQ_NAmgWEXDPGfGRA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726141659; x=1726746459; 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=n9dDDrecIM1y8v3Vzp3bpAwQJvOV/wJaX6U1y5/yapQ=; b=w0hiuSH9ogRfJk/Oe4SjTeYFkUs64sWigapWN18NhMXYCdQ3ensHItmvJ+Ce56F2yB SVRSKTp6YRH6zKt5Ap8zB7MMyKdGRSsOuUrcZ/8TtZ+w667W/o2BpT3+t+eqGx2LJfwP riOngoB4yQ0CZRxAeZ7nDNOrug1G6z/TwafK308QSM+NKNbfh5LLYdLA6iTXSfJQ4okv 2lnCuarurqmWli/iXx7Gpy7y91KQdhgRwGsyiVt4ot/ZJFiCpZqzFooP2IjMXmbNvUg2 zk0lsddvD6Ly7/4C4O6vu8MfY45nP6z4MKzfCwlDu8ho7nt5ShbJdMV8dQIBb3nwlOqW 49/Q== X-Gm-Message-State: AOJu0YwYk34u8ZxpsxlAQ3xZrqQudn4o111mOE+4dT+qD4Gli6viItu3 MaetBOqq6bFivsr95JKQbqfuxa94eGHdgyMm+SAmMnqcH0uF/IbX9ke/vurBbYZPZVzyXMn49PA iTvrhi/26gx8fN1j/SN5PZZLBNuhx/Av4vwaw8sQK2yzzp2ii1qKqYjH03mbM7K2O+yU10eqcef 00FKfi9uPS8q6Vb2Zv5zE7SqrV0KZIGmDE5tIxZ7E= X-Received: by 2002:a05:6512:3d17:b0:52c:cca8:a9fb with SMTP id 2adb3069b0e04-53678fed160mr1471314e87.42.1726141659019; Thu, 12 Sep 2024 04:47:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv09IvZ6bQ9We9Q6y8nEDmadjeQnXpMg47U1+ZlyCRzd025Aqpd/sJ483AuVBEbRpHNj8L0A== X-Received: by 2002:a05:6512:3d17:b0:52c:cca8:a9fb with SMTP id 2adb3069b0e04-53678fed160mr1471280e87.42.1726141657674; Thu, 12 Sep 2024 04:47:37 -0700 (PDT) From: Jakub Palacky To: devel@lists.libvirt.org Subject: [PATCH v2 1/2] util/virxml: use xmlCtxtGetLastError when applicable Date: Thu, 12 Sep 2024 13:47:21 +0200 Message-ID: <20240912114722.397010-2-jpalacky@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240912114722.397010-1-jpalacky@redhat.com> References: <20240912114722.397010-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: VWKFZ6LEBTLPU2SW3B2RM3XBEIIWKGV5 X-Message-ID-Hash: VWKFZ6LEBTLPU2SW3B2RM3XBEIIWKGV5 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: 1726141687224116600 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 Reviewed-by: J=C3=A1n Tomko --- src/util/virxml.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index a7b75fd7b3..51173303fe 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1029,14 +1029,15 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNU= SED, ...) g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *contextstr =3D NULL; g_autofree char *pointerstr =3D NULL; - + const xmlError *lastError =3D xmlCtxtGetLastError(ctxt); =20 /* conditions for error printing */ if (!ctxt || (virGetLastErrorCode()) || ctxt->input =3D=3D NULL || - ctxt->lastError.level !=3D XML_ERR_FATAL || - ctxt->lastError.message =3D=3D NULL) + lastError =3D=3D NULL || + lastError->level !=3D XML_ERR_FATAL || + lastError->message =3D=3D NULL) return; =20 if (ctxt->_private) @@ -1078,19 +1079,19 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNU= SED, ...) =20 pointerstr =3D virBufferContentAndReset(&buf); =20 - if (ctxt->lastError.file) { + if (lastError->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, + lastError->file, + lastError->line, + lastError->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, + lastError->line, + lastError->message, contextstr, pointerstr); } --=20 2.46.0 From nobody Mon Dec 15 09:46:14 2025 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 172614170105258.328222504798305; Thu, 12 Sep 2024 04:48:21 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D1A6C157F; Thu, 12 Sep 2024 07:48:19 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2BECE1583; Thu, 12 Sep 2024 07:47:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 95F9F137D; Thu, 12 Sep 2024 07:47:43 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 2DB1D137F for ; Thu, 12 Sep 2024 07:47:43 -0400 (EDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-438-fa-Cq-m2NN6ycgPVHvxPkA-1; Thu, 12 Sep 2024 07:47:42 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb6dc3365so6545175e9.2 for ; Thu, 12 Sep 2024 04:47:41 -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 ffacd0b85a97d-378956d3654sm14299595f8f.78.2024.09.12.04.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 04:47:38 -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=1726141662; 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=5tgTeSGEqB8/76jKbaBnwWz5ydZj0tpjQ6vxvigvj5M=; b=FCy4xIzzMfLonrZQ1sE+Or9uZ7kTOvlH/z0UvQSUpffy5CR2wBolNUfRCfKkQEj94NAKvs FdixKn6cPVbiP5Ywbm1d/Teh/KRd8qzwHrTw8kQC2QJKUhTXZJIvJ0C4O3BDoo/1hoh4vi 48lWhu6CnXCdZIgTb73UCTFXHf9LcPI= X-MC-Unique: fa-Cq-m2NN6ycgPVHvxPkA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726141659; x=1726746459; 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=5tgTeSGEqB8/76jKbaBnwWz5ydZj0tpjQ6vxvigvj5M=; b=tHacYhcEkdGYLzTr2/gtpNC+ap2rzReyYrAka9c6pGA44dW0e89q6hG1ztWglhEz70 VA0bEmb4rYy9vbntZdBaRZGKlsuzVb+6J7lVRu2G35l/RHh7saUr2x9GDx6bt4T7wIST WBE/NimrYVHOuQaxejB4Usy0WXtBN0y7E0yPkQ5uiUeTmlv9IZggrqRHkFGeyvIGiIAz o2ZkYrx12RHkqipLYGeXuhhRxmmxT07vpXopJarxi8fOmLsUnseU1/DJnlTiRIiN5SZf 1DF/29NXR0Z3faUuazYC+CpjLW+UTYUnyvxQJvETaGHe0oGHliLdmKDC6Vlg/1hqSFQR TjQA== X-Gm-Message-State: AOJu0YxeiXr96+aOzi7lDlbv48AXglPo3/Rr/ao50YejbqB5W3Eoq0aW lJ/wEeu4sJxy1hgr8qNXI7d8p3XSnF6vaGwN3FdcuMekZFSg2ZYfu+/HRBZOpul3oJtT/HAj7L7 kNqH73LK0Egigu7CQawVRqlLO9jqnxzTfINLaWxUD43cQb0we7zLM0Rn0ePAvljVLuYuQz5v/F2 tTROZkkT90BmeikOr75cfbumgQea9gRfjqP9SiwVY= X-Received: by 2002:a5d:6da5:0:b0:374:ca43:abff with SMTP id ffacd0b85a97d-378c2d1176dmr1800525f8f.26.1726141659246; Thu, 12 Sep 2024 04:47:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+X67jj3H2DKdEdGrot87QsSD83io38A3QNfPN18dgLZvcNFJiYJaDRX3fyBO5Pq0jqcHvFA== X-Received: by 2002:a5d:6da5:0:b0:374:ca43:abff with SMTP id ffacd0b85a97d-378c2d1176dmr1800501f8f.26.1726141658634; Thu, 12 Sep 2024 04:47:38 -0700 (PDT) From: Jakub Palacky To: devel@lists.libvirt.org Subject: [PATCH v2 2/2] vmx: use xmlBufferDetach() when applicable Date: Thu, 12 Sep 2024 13:47:22 +0200 Message-ID: <20240912114722.397010-3-jpalacky@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240912114722.397010-1-jpalacky@redhat.com> References: <20240912114722.397010-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: CA52VLIMSFC57V6XYWHKWEQB23BZUK3L X-Message-ID-Hash: CA52VLIMSFC57V6XYWHKWEQB23BZUK3L 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: 1726141702964116600 Content-Type: text/plain; charset="utf-8"; x-default="true" xmlBuffer->content was deprecated in libxml2 v2.13.0-33-gb34dc1e4 xmlBufferDetach(xmlBuffer) should be used instead Signed-off-by: Jakub Palacky Reviewed-by: J=C3=A1n Tomko --- src/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 227744d062..de16c1f634 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -794,7 +794,7 @@ virVMXConvertToUTF8(const char *encoding, const char *s= tring) goto cleanup; } =20 - result =3D (char *)g_steal_pointer(&utf8->content); + result =3D (char *)xmlBufferDetach(utf8); =20 cleanup: xmlCharEncCloseFunc(handler); --=20 2.46.0