From nobody Sun Feb 8 11:45:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607466081; cv=none; d=zohomail.com; s=zohoarc; b=hvCaoEykBcyrsjlZJNg8xUa0z+Kye2ut0MIbNr7gHS28bONCd1wuzGW2lrynNStjAxOuoXcsX7fq0Xm8tWHyN223Wvnc3gcNiLvxu25k0KmGsJPWt3W98rq6Rgpb4k0SISfS7eHrAfHBlXGiavQVEHAwyD8KAWtFURk1/xsPvBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607466081; h=Content-Type:Content-Transfer-Encoding:Cc: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=JCn92J9EOgdu4c0YmIXOgnmBeKYEhHu712YaEGE1qDI=; b=DbWEJVdY7QEyz+cbgzdQPztiGnu9LvJnzywcmmPTtz0F7s80zBDUQBV2LghEV+w6LT1suXDZcUOdbTR6BNIFSQ8ruvBtWSLrKEUGS4CibFDmxrmwX1kEzNZOZfqWbsR3wr1XE64KixykuIAopf4o5udLJdf9ukBiLXlAdjoqTP0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 16074660816351019.5581098184148; Tue, 8 Dec 2020 14:21:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-KR-iMSruOzOmdSh-zOa3XA-1; Tue, 08 Dec 2020 17:21:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7C23D803620; Tue, 8 Dec 2020 22:21:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 586725D9DD; Tue, 8 Dec 2020 22:21:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2662A1809CA7; Tue, 8 Dec 2020 22:21:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B8ML6R1017301 for ; Tue, 8 Dec 2020 17:21:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id D84F3112D41B; Tue, 8 Dec 2020 22:21:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D420D112D411 for ; Tue, 8 Dec 2020 22:21:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C0E181875040 for ; Tue, 8 Dec 2020 22:21:06 +0000 (UTC) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-77-fob8Kyf3NI2ad3oxaL9xoA-1; Tue, 08 Dec 2020 17:21:04 -0500 Received: by mail-qk1-f180.google.com with SMTP id z11so212911qkj.7 for ; Tue, 08 Dec 2020 14:21:04 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id c14sm75057qtg.85.2020.12.08.14.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 14:21:03 -0800 (PST) X-MC-Unique: KR-iMSruOzOmdSh-zOa3XA-1 X-MC-Unique: fob8Kyf3NI2ad3oxaL9xoA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JCn92J9EOgdu4c0YmIXOgnmBeKYEhHu712YaEGE1qDI=; b=laVMgQ5VoSjjKg90D/7mqEnZnjTq21rDCWVAi5Ixjz0RdLIRYhntlHDcdmr2A2MTn3 eP9QuHmmmNQ28kwdfoqst/IXZ1OMQibFH+S32TCdj2Wcf08fZSqDKOJ1f/3vC2O8ju5m TFq9TJiwLD3Hi7CvNCIvdMNnkesyiJ+EbT/1Rjk9fRHseKnZfW3vrP7wO6GBVtqeTi57 xR2aPQfh2smZsFugjmeVxK+KN97F18AkiaY4WS6D8dyVkiTFQtMY3DmFVs95anFyWkSP XndVLgUp9+EFvWCm1y6xrSuUBk/GtjEPFlvMz/P59TEkI98leIaYNYTcJrKDpvPiqc3q ePeg== X-Gm-Message-State: AOAM531h/IAjq+CvAlYzh3RE5Wffo0UkzaBvT6FWAmfzVH9e+eN3RcmY KobdQhDjMpGlen0CBjW6N1DnwtjsuUo= X-Google-Smtp-Source: ABdhPJygu6Gbzi/X45sQZgkDCK2bkLlQz10rnLhpx1zuZj9Cn48bGd1MDYwfXmK4Rz47RIJQU2N1mw== X-Received: by 2002:ae9:f306:: with SMTP id p6mr32795082qkg.94.1607466063616; Tue, 08 Dec 2020 14:21:03 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 07/14] domain_validate.c: rename virSecurityDeviceLabelDefValidateXML() Date: Tue, 8 Dec 2020 19:20:23 -0300 Message-Id: <20201208222030.1302229-8-danielhb413@gmail.com> In-Reply-To: <20201208222030.1302229-1-danielhb413@gmail.com> References: <20201208222030.1302229-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The function isn't doing XML validation of any sort. Rename it to be compatible with its actual use. While we're at it, change the VIR_ERR_XML_ERROR error being thrown in the function to VIR_ERR_CONFIG_UNSUPPORTED. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 8 ++++---- src/conf/domain_validate.c | 18 +++++++++--------- src/conf/domain_validate.h | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 220bb8cdcf..6578055119 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6164,10 +6164,10 @@ virDomainChrSourceDefValidate(const virDomainChrSou= rceDef *src_def, break; } =20 - if (virSecurityDeviceLabelDefValidateXML(src_def->seclabels, - src_def->nseclabels, - def->seclabels, - def->nseclabels) < 0) + if (virSecurityDeviceLabelDefValidate(src_def->seclabels, + src_def->nseclabels, + def->seclabels, + def->nseclabels) < 0) return -1; =20 return 0; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index bc5ca3f668..e9427cffa8 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -195,10 +195,10 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDis= kBus bus, =20 =20 int -virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabe= ls, - size_t nseclabels, - virSecurityLabelDefPtr *vmSeclabels, - size_t nvmSeclabels) +virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels, + size_t nseclabels, + virSecurityLabelDefPtr *vmSeclabels, + size_t nvmSeclabels) { virSecurityDeviceLabelDefPtr seclabel; size_t i; @@ -213,7 +213,7 @@ virSecurityDeviceLabelDefValidateXML(virSecurityDeviceL= abelDefPtr *seclabels, continue; =20 if (!vmSeclabels[j]->relabel) { - virReportError(VIR_ERR_XML_ERROR, "%s", + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("label overrides require relabeling to be= " "enabled at the domain level")); return -1; @@ -297,10 +297,10 @@ virDomainDiskDefValidate(const virDomainDef *def, } =20 for (next =3D disk->src; next; next =3D next->backingStore) { - if (virSecurityDeviceLabelDefValidateXML(next->seclabels, - next->nseclabels, - def->seclabels, - def->nseclabels) < 0) + if (virSecurityDeviceLabelDefValidate(next->seclabels, + next->nseclabels, + def->seclabels, + def->nseclabels) < 0) return -1; } =20 diff --git a/src/conf/domain_validate.h b/src/conf/domain_validate.h index fe7c752e8c..aef169a4c9 100644 --- a/src/conf/domain_validate.h +++ b/src/conf/domain_validate.h @@ -28,9 +28,9 @@ int virDomainDefBootValidate(const virDomainDef *def); int virDomainDefVideoValidate(const virDomainDef *def); int virDomainVideoDefValidate(const virDomainVideoDef *video, const virDomainDef *def); -int virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *sec= labels, - size_t nseclabels, - virSecurityLabelDefPtr *vmSeclabe= ls, - size_t nvmSeclabels); +int virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclab= els, + size_t nseclabels, + virSecurityLabelDefPtr *vmSeclabels, + size_t nvmSeclabels); int virDomainDiskDefValidate(const virDomainDef *def, const virDomainDiskDef *disk); --=20 2.26.2