From nobody Wed May 15 06:23:47 2024 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=1667398302; cv=none; d=zohomail.com; s=zohoarc; b=nWU7pTzY/1JCjPYlxBAHR4eaZVxE1KgoRUlex3T5s3hukHsxJJ6Zz/EC567FMoRHVL2NfHmndvMfvJ0P9752knLeLo3C9RjH/XY0Fs4AUL9JgTlZ8gFcKlnVTo8Z7+1dDNIhoqJbzdsGUElrKgCddiFxq1BC6AVis4CUGNsJB2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667398302; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=RVMeXpMnz/HpVoARmLeoiw/UP9vSkpP/39ZCpe8rwMA=; b=OAwjwHCYSyPePzl6C7UltsOB8YmbIHK77P34tIHpSCz6F+gApoShgrArRMgbAbCrx928QP9H+iQubE2aV3qmJt35KFUZRwoXCdad6XZQtp4lFB3eti6vf1Uob51KTn3e18jHqHSrbRm9/p2HcL+6neqQV1AR3EtVyUlhmCN6348= 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 1667398302321209.29625061594004; Wed, 2 Nov 2022 07:11:42 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-zAga6ILlO32gBjQjTgvAlA-1; Wed, 02 Nov 2022 10:11:30 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 846992822535; Wed, 2 Nov 2022 14:10:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A76FF49BB60; Wed, 2 Nov 2022 14:10:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8FE3F1946597; Wed, 2 Nov 2022 14:10:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 51B271946594 for ; Wed, 2 Nov 2022 14:10:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 34A86141511F; Wed, 2 Nov 2022 14:10:23 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 10E34140EBF5 for ; Wed, 2 Nov 2022 14:10:23 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id EFCF4243015; Wed, 2 Nov 2022 15:10:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667398301; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RVMeXpMnz/HpVoARmLeoiw/UP9vSkpP/39ZCpe8rwMA=; b=Yvuk0xJPXId/uRhPlrhGu9otoV9UN9Q7EK9JE1/BgJsgazVVGrI5U+Wts8W8FBfs+d88kp x7CMEJLhPoFLMpnsGLJK3jMiDx70R+Fu0O8W5uXljSSDYQVmEIMc0y2T3qGevIvYDwuLS6 9AFDaYMat314MmG89mMVIEpWgnTv6B4= X-MC-Unique: zAga6ILlO32gBjQjTgvAlA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] conf: Skip virDomainNetDefParseXMLDriver if driver_node is NULL Date: Wed, 2 Nov 2022 15:10:19 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1667398304365100001 Content-Type: text/plain; charset="utf-8" Trying to parse node which does not exist makes no sense. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4cd9ffc194..fda1c6caa6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8831,8 +8831,10 @@ virDomainNetDefParseXMLDriver(virDomainNetDef *def, { xmlNodePtr driver_node; =20 - if ((driver_node =3D virXPathNode("./driver", ctxt)) && - (virDomainVirtioOptionsParseXML(driver_node, &def->virtio) < 0)) + if (!(driver_node =3D virXPathNode("./driver", ctxt))) + return 0; + + if (virDomainVirtioOptionsParseXML(driver_node, &def->virtio) < 0) return -1; =20 if (def->type !=3D VIR_DOMAIN_NET_TYPE_HOSTDEV && --=20 2.38.1