From nobody Thu Apr 2 23:55:48 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1774525971; cv=none; d=zohomail.com; s=zohoarc; b=AR+L9PpXIgUMnO+EnPTM3JjVxF87DO4WpKHDd3e4ES2oDn4Ps/NfDDhBDLqCSE2DsW8ebcU8HwCG4zPtK288OEbra0zE8g9ph1RXN8/YkSptS0U/K7ujwnTwvZgUQB7+soJQO/jSzkj+DR84tiVXZf4JgoDtXvK62zZUTlQ1KPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774525971; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=hfqi2PHU7Gxm8MzwZcwikLIqi6mJjz2D1dUzi48knwM=; b=ZA2pgBsPcEbc+2+SVDV0zJjTwXWoDHW9bNaQYXuI+HnIrimvmpcReeYturnoqWLJLR7GAeevsTCYnhjou3N2oMYtOqlUI8VKm4tPjWdjMMxG5MH8iUZjg0p3ZdI6oE3aiiJMpCmVxHiQcS7IdSpAsbgQe+acH38Wp4tVUgPhXeI= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1774525971253205.9863147269847; Thu, 26 Mar 2026 04:52:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 679843F835; Thu, 26 Mar 2026 07:52:50 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8F28C418E4; Thu, 26 Mar 2026 07:51:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id DABF53F2F8; Thu, 26 Mar 2026 07:51:31 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 973653F309 for ; Thu, 26 Mar 2026 07:51:31 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-vEF06fCsO-W7E68xJbsqVQ-1; Thu, 26 Mar 2026 07:51:30 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A4AF1956096 for ; Thu, 26 Mar 2026 11:51:29 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C70DE1955D71 for ; Thu, 26 Mar 2026 11:51:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774525891; h=from:from: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; bh=hfqi2PHU7Gxm8MzwZcwikLIqi6mJjz2D1dUzi48knwM=; b=EaSNgcPe7j+1JSUB0bEVn651xFW55X4LY8a//9yGZ466+ZynqxR8CEBsfTQHkXyFQojiF5 l792j3+uTG2IVqYJ/387Piqmj2JR/QvGDJ5QvYtao9E4VO/7lTUxcN/v8V1Xx3R4/C67yt rtjWbu34Qd35YiNOfrBWqFVsMesB8Co= X-MC-Unique: vEF06fCsO-W7E68xJbsqVQ-1 X-Mimecast-MFC-AGG-ID: vEF06fCsO-W7E68xJbsqVQ_1774525889 To: devel@lists.libvirt.org Subject: [PATCH 1/3] conf: Fix seclabel type parsing wrt default value Date: Thu, 26 Mar 2026 12:51:23 +0100 Message-ID: <2a314bacd108f921937dafff08fb4868678c7712.1774525799.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ZmTrzdgEJDMKueHN1CY8f_9C97zxGs1fJK8RgSad2gc_1774525889 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FYK5OQ3M7O4U6NMOHR4WKQITXNQ26URC X-Message-ID-Hash: FYK5OQ3M7O4U6NMOHR4WKQITXNQ26URC X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1774525972730158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Prior to v7.10.0-rc1~26 seclabels defaulted to VIR_DOMAIN_SECLABEL_DYNAMIC (type=3D'dynamic'). But after switching the parser to virXMLPropEnum() the type is overwritten to VIR_DOMAIN_SECLABEL_DEFAULT because the first thing that the helper function does is to set variable that holds the result to zero. Switch to virXMLPropEnumDefault() to restore the previous behavior. Fixes: f7ff8556ad9ba8d81408e31649071941a6a849a3 Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 84425ff39d..b1ee519ff6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7076,14 +7076,13 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, if (!(seclabel =3D virSecurityLabelDefNew(model))) return NULL; =20 - /* set default value */ - seclabel->type =3D VIR_DOMAIN_SECLABEL_DYNAMIC; - - if (virXMLPropEnum(ctxt->node, "type", - virDomainSeclabelTypeFromString, - VIR_XML_PROP_NONZERO, - &seclabel->type) < 0) + if (virXMLPropEnumDefault(ctxt->node, "type", + virDomainSeclabelTypeFromString, + VIR_XML_PROP_NONZERO, + &seclabel->type, + VIR_DOMAIN_SECLABEL_DYNAMIC) < 0) { return NULL; + } =20 if (seclabel->type =3D=3D VIR_DOMAIN_SECLABEL_STATIC || seclabel->type =3D=3D VIR_DOMAIN_SECLABEL_NONE) --=20 2.52.0