From nobody Tue Feb 10 04:29:44 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=1641993123; cv=none; d=zohomail.com; s=zohoarc; b=eRzhZyKdMT8SGGTm7ZkpquodqpEk43rZ6GnmUkwVbU0Tc3Ouv2MLadzSrE0DKx+DjIPP4IhOXtgzeSCVzTaoJcDzl7LxWZmc1eSTwfhvIEkiSZc85pnVcqJ/T2VFV7ZQgROEqf7/gBy/PLUEcZ997UAC215DWr5SiqdwMLWc6U8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641993123; 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=jD5vmJUiz1PvGl5aX/0U/4LvdeRTzLHx0EvQAnSQ54A=; b=dqjLeLZOWzd0tA6OPV6dlNiDucNA0T1+WKoKfukCUGXWU1O3F/N7m/Q+E1hvMllbEIkRTx/zabI3asoHHGszDKOc3nqPLYlGgWWVakjtfMRE6JucuxwZOOvO06ONahirI+E0+27MC8vVD3bL8W1pCW+C5Rn4hA/LreyyNx1V7/A= 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 1641993123062247.9547935413351; Wed, 12 Jan 2022 05:12:03 -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-636-X68tWZhyPKadvX4wAwH2dA-1; Wed, 12 Jan 2022 08:11:26 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 92BA6100D847; Wed, 12 Jan 2022 13:11:20 +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 4EEF1753C3; Wed, 12 Jan 2022 13:11:20 +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 0F1B918077BC; Wed, 12 Jan 2022 13:11:20 +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 20CDBFGd004329 for ; Wed, 12 Jan 2022 08:11:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id A596E26358; Wed, 12 Jan 2022 13:11:15 +0000 (UTC) Received: from work.speedport.ip (unknown [10.39.193.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6B4A2634A; Wed, 12 Jan 2022 13:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641993122; 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=jD5vmJUiz1PvGl5aX/0U/4LvdeRTzLHx0EvQAnSQ54A=; b=ANzS9lgek/DSxI3IkmLDpfYFGAItOYS6fKRM2EhSOTt12oiMA+GzyqAidKLRX20dYQnMTr MgMzh1HzCmRBwZyRJjJnzqLbT12tzUawQZIR248jc4mYlnwUOoPvz6AdGWiYYy8riMWBtB 2os97ox1vVHCL+wBFxNeg+ZBu28bzH0= X-MC-Unique: X68tWZhyPKadvX4wAwH2dA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/14] virInterfaceDefParseXML: Inline trivial virInterfaceDefParseName Date: Wed, 12 Jan 2022 14:10:08 +0100 Message-Id: <20220112131015.100288-8-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.11 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: 1641993124609100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/interface_conf.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 47f9da797d..f3fc47bd69 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -116,23 +116,6 @@ virInterfaceDefFree(virInterfaceDef *def) } =20 =20 -static int -virInterfaceDefParseName(virInterfaceDef *def, - xmlXPathContextPtr ctxt) -{ - char *tmp; - - tmp =3D virXPathString("string(./@name)", ctxt); - if (tmp =3D=3D NULL) { - virReportError(VIR_ERR_XML_ERROR, - "%s", _("interface has no name")); - return -1; - } - def->name =3D tmp; - return 0; -} - - static int virInterfaceDefParseMtu(virInterfaceDef *def, xmlXPathContextPtr ctxt) @@ -662,8 +645,10 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, } def->type =3D type; =20 - if (virInterfaceDefParseName(def, ctxt) < 0) - return NULL; + if ((def->name =3D virXMLPropString(ctxt->node, "name")) =3D=3D NULL) { + virReportError(VIR_ERR_XML_ERROR, "%s", _("interface has no name"= )); + return NULL; + } =20 if (parentIfType =3D=3D VIR_INTERFACE_TYPE_LAST) { /* only recognize these in toplevel bond interfaces */ --=20 2.31.1