From nobody Sat May 4 15:58:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1568294981; cv=none; d=zoho.com; s=zohoarc; b=c/bdkr1EHUeHQ7KaAFfwFbmMO3t2tI729YWpTOUVY//8lcEdwSpLCjHXDvRSiU65cIgEvplCAmEZFq7YF1+3fj2GM3s9s/HXsSEw9vM4pXl7K24z54KrSo9XasyHNrJutHJcItd7yl2Jdb9wBEgUQgqxU3VHto6ClDrxIGnQUlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568294981; 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:ARC-Authentication-Results; bh=ZXJcXbxD/TLiPDfN/W2Sj15Z0PdRUHPruGeN25XXwV0=; b=f68yAN+NeLvNF+ENvBwn2KyJI7A971tFfryrwHhZ1xYrnhQmAkl0wKvLWfX8tWMKnXeM4TjLyDlfcLC9DUWwDBK3L5EVTaB27jM/oGfaTSJZaT3EgVh+b2Sub2IOPDcxi/hG3xzS1O64Cy4oRGEAUfwKQ92pD1Ea+5jlC4swnyc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156829498126834.41364328194413; Thu, 12 Sep 2019 06:29:41 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D7CA22A09A8; Thu, 12 Sep 2019 13:29:38 +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 B48BD600C8; Thu, 12 Sep 2019 13:29:36 +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 98C0A180B536; Thu, 12 Sep 2019 13:29:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8CDOSNP012254 for ; Thu, 12 Sep 2019 09:24:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 10AC460C57; Thu, 12 Sep 2019 13:24:28 +0000 (UTC) Received: from dhcp-17-64.lcy.redhat.com (unknown [10.42.17.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80DD060CDA; Thu, 12 Sep 2019 13:24:24 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 12 Sep 2019 14:24:18 +0100 Message-Id: <20190912132418.7124-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: avoid looking up network port that doesn't exist 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 12 Sep 2019 13:29:39 +0000 (UTC) If the hypervisor driver has not yet created the network port, the portid field will be "00000000-0000-0000-0000-000000000000". If a failure occurs during early VM startup, the hypervisor driver may none the less try to release the network port, resulting in an undesirable warning: 2019-09-12 13:17:42.349+0000: 16544: error : virNetworkObjLookupPort:1679 : network port not found: Network port with UUID 00000000-0000-0000-0000-000000000000 does not exist By checking if the portid UUID is valid, we can avoid polluting the logs in this way. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3dc638f0de..b1f8a13319 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30994,6 +30994,12 @@ virDomainNetReleaseActualDevice(virConnectPtr conn, virNetworkPortPtr port =3D NULL; int ret =3D -1; =20 + /* Port might not exist if a failure occurred during VM startup */ + if (!virUUIDIsValid(iface->data.network.portid)) { + ret =3D 0; + goto cleanup; + } + if (!(net =3D virNetworkLookupByName(conn, iface->data.network.name))) goto cleanup; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list