From nobody Mon Feb 9 23:43:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641993109; cv=none; d=zohomail.com; s=zohoarc; b=GdgTV5RKWTARXz7Z+bsmPiYwcLxhAofX71QqCeiYUjMnmpVXAOimx7hiUccHGjDr2bpDsN1zSayAjkTEQr7X2qC3NPPfRZ3bJJdZVPiE4hHWRSbUMFexzn9L8r7p+778uyjGcIUnP44N58lv2NSPRGvnuNBM24YtWNy+ThUDRjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641993109; 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=rI48cr2VwCo5lEokJNNHwww1u7/h1nJoXkKS3E6q5Bs=; b=CY52IcPH3Jfcok5lOXlPfnDSkfI9fkrNXV+NyK9GHtl2+JrJKMQI/5gacNaEfXYUN78UD+jKeKlB5vgxnD3vzuPpl0uMg1+MRn+LSKE2WngtdOOdEtZ5eoTY7smWecLwNtB486SevzCL72j6duqwPqPCmIsMGlApEEMfbhrItqI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641993109869640.538810744731; Wed, 12 Jan 2022 05:11:49 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-445-I3bKRC4dOemJ_m8lrbqirQ-1; Wed, 12 Jan 2022 08:11:47 -0500 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 8BA69100CD17; Wed, 12 Jan 2022 13:11:40 +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 680797BB65; Wed, 12 Jan 2022 13:11:40 +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 36B0B4A7CA; Wed, 12 Jan 2022 13:11:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20CDBbeL004708 for ; Wed, 12 Jan 2022 08:11:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 094B22634A; Wed, 12 Jan 2022 13:11:37 +0000 (UTC) Received: from work.speedport.ip (unknown [10.39.193.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43B3A26364; Wed, 12 Jan 2022 13:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641993108; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rI48cr2VwCo5lEokJNNHwww1u7/h1nJoXkKS3E6q5Bs=; b=FyoQ5mBhj1cZd9O7MjtlEU2sfgbMdT7VHmTZHqtM2KrMAcDnGQ35/OmZyLY6HfDb/sGbQp 1IRdGh5zbXs7jACDD7hd/MmUHqhKzXJBhvbWxDeY5gEIp+9WbKguVI2aFyFhIB0K5vZh0c VS4Adi6ojveai+VfwpGIseQxWxWD33k= X-MC-Unique: I3bKRC4dOemJ_m8lrbqirQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 14/14] virInterfaceDefParse: Simplify and cleanup Date: Wed, 12 Jan 2022 14:10:15 +0100 Message-Id: <20220112131015.100288-15-twiederh@redhat.com> In-Reply-To: <20220112131015.100288-1-twiederh@redhat.com> References: <20220112131015.100288-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: 1641993110852100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/interface_conf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 7c2a0f162c..305a312327 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -704,14 +704,13 @@ virInterfaceDefParse(const char *xmlStr, unsigned int flags) { g_autoptr(xmlDoc) xml =3D NULL; - virInterfaceDef *def =3D NULL; =20 - if ((xml =3D virXMLParse(filename, xmlStr, _("(interface_definition)")= , "interface.rng", - flags & VIR_INTERFACE_DEFINE_VALIDATE))) { - def =3D virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml)); - } + xml =3D virXMLParse(filename, xmlStr, _("(interface_definition)"), + "interface.rng", flags & VIR_INTERFACE_DEFINE_VALIDA= TE); + if (!xml) + return NULL; =20 - return def; + return virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml)); } =20 =20 --=20 2.31.1