From nobody Mon Feb 9 06:49:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1629459345; cv=none; d=zohomail.com; s=zohoarc; b=Rw7VN1BrQZ4OmvqpaVBSQQLLuhTal8t5y7O+27+/ou3ElNNfxSXAehMwI2csXlcykAKYYcJINqap29e1HtMrA9xvPPiPBARkLK5rG70FE55bAyuOiDN0DWno6fkh06CoRaArxUEpMpN2wI7Jrs4uLZNWnacVZqeVAIO89zf8Q2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629459345; 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=URA2KUNNzoSY1jzNnDt4VyIae+KF68HMAEbxXhb5NZA=; b=he9cZHiwQb7w5Ycc1ji1ipOi9MI/KEkqVzAOdXO4Oiy9ZK3kIykr1lj4Sja6Cdjuo3ghlnHiWPX9JHDLcGmfmX/wEj2Qfhv+mJ51YeB3Ntvi9bnkSBQYehOdxg9Qj79LOPLLcS+ZfWbnHkb4MYeav0/eJElGFw5//O5tyL/Balc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 162945934585421.40768801311731; Fri, 20 Aug 2021 04:35:45 -0700 (PDT) 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-428-wCILC6urOqqOe-4V4F0Baw-1; Fri, 20 Aug 2021 07:35:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F8552E78; Fri, 20 Aug 2021 11:35:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 696E95C1D0; Fri, 20 Aug 2021 11:35:37 +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 288B94BB7C; Fri, 20 Aug 2021 11:35:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17KBTjCj003798 for ; Fri, 20 Aug 2021 07:29:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B96E18A66; Fri, 20 Aug 2021 11:29:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id C92415D9FC for ; Fri, 20 Aug 2021 11:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629459344; 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=URA2KUNNzoSY1jzNnDt4VyIae+KF68HMAEbxXhb5NZA=; b=RilZGhkMV5I4x9nj5IM7TIxbOavOHo7q3dspI91mbQMeNbg5bHto162exeHi/OZXC4NuuV c56/nIFbXq/goNUd2s8/hxGUzqSaTkkASUyt4eBzmamICju+G/OBFBk+RaPwqcJFvnnIGb 1Wrl8/+dy67X7RosqIl83PuoKrz2MSs= X-MC-Unique: wCILC6urOqqOe-4V4F0Baw-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 3/4] src: allow validation flag in interface define Date: Fri, 20 Aug 2021 13:28:51 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.16 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 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629459346294100001 Content-Type: text/plain; charset="utf-8" We need to validate the XML against schema if option 'validate' was passed to the 'iface-define' virsh command. For that we need to allow validation flag and propagate flags to parse function. Signed-off-by: Kristina Hanicova --- src/interface/interface_backend_netcf.c | 4 ++-- src/test/test_driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 9f93cdd657..78fd4f9bc7 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -894,11 +894,11 @@ static virInterfacePtr netcfInterfaceDefineXML(virCon= nectPtr conn, virInterfaceDef *ifacedef =3D NULL; virInterfacePtr ret =3D NULL; =20 - virCheckFlags(0, NULL); + virCheckFlags(VIR_INTERFACE_DEFINE_VALIDATE, NULL); =20 virObjectLock(driver); =20 - ifacedef =3D virInterfaceDefParseString(xml, 0); + ifacedef =3D virInterfaceDefParseString(xml, flags); if (!ifacedef) { /* error was already reported */ goto cleanup; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 450510ee54..67db02b25d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -6156,10 +6156,10 @@ testInterfaceDefineXML(virConnectPtr conn, virInterfaceDef *objdef; virInterfacePtr ret =3D NULL; =20 - virCheckFlags(0, NULL); + virCheckFlags(VIR_INTERFACE_DEFINE_VALIDATE, NULL); =20 virObjectLock(privconn); - if ((def =3D virInterfaceDefParseString(xmlStr, 0)) =3D=3D NULL) + if ((def =3D virInterfaceDefParseString(xmlStr, flags)) =3D=3D NULL) goto cleanup; =20 if ((obj =3D virInterfaceObjListAssignDef(privconn->ifaces, def)) =3D= =3D NULL) --=20 2.31.1