From nobody Sun May 5 11:25:04 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=1638447041; cv=none; d=zohomail.com; s=zohoarc; b=hMQaL/ywd+wxYbZLdeVUSDl8JwcbjuMp9VRN+okn4IIkQQoXZRVEId4YN2YsK4NmwCwFxdBBHb7YwfKKYxTpdy0CRZIiiznYu3JDMhgaq0kc3l1yZv0Da6NWaQ0u2V9y3zo2yiwrHQTxWdvcM59zV0pPIiCC8YzFbzWHUAR+b/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638447041; 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=651VyNZ4sdzUXWmsZSWnM063ki+1HrS2dkIuqEvVATk=; b=kdW7HajhN6iJsBisJLwqooynhjPXNqGH/loYEqLBSdyku4OClXAzI9eHPkYC3g2t9C6fPgyGgJbnWplNWdjdvwxBEKE79ZoOXhD9M9zHI0CE422P8u4iFJa8QMM+ZFdD0WLdP+cTTYjTbKHwsaN0sPISpB6Lw4bxuOtnpizAV7w= 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 1638447041716353.4249969769396; Thu, 2 Dec 2021 04:10:41 -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-86-ZfWXOC00PyqlaffrE-aJkw-1; Thu, 02 Dec 2021 07:10:37 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0813E80734A; Thu, 2 Dec 2021 12:10:31 +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 9200C19729; Thu, 2 Dec 2021 12:10:28 +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 BD2F94BB7C; Thu, 2 Dec 2021 12:10:24 +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 1B2CANjC012301 for ; Thu, 2 Dec 2021 07:10:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9636119724; Thu, 2 Dec 2021 12:10:23 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F98819C46 for ; Thu, 2 Dec 2021 12:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638447040; 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=651VyNZ4sdzUXWmsZSWnM063ki+1HrS2dkIuqEvVATk=; b=eFuKAv20O0sWyJGAR4xmp8JE/+9QBfYvCAe5f8He8iSUL8QEkca816AjY3Y9QQKEZnaB8P HJCbYVi40RJZuraRBWbp5BwAnB4opRST4Mg7Is6Y4bBjU3qRzGuovpgr4VyE1YX1Gh/E0B EbzT62sheOwn/2swubS7COqxkceAMW0= X-MC-Unique: ZfWXOC00PyqlaffrE-aJkw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virnetdevveth: Do report error if creating veth fails Date: Thu, 2 Dec 2021 13:10:20 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.23 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: 1638447042189100001 Content-Type: text/plain; charset="utf-8" For some weird reason we are ignoring errors when creating veth pair that netlink reports. This affects the LXC driver which creates interfaces for container in virLXCProcessSetupInterfaces(). If creating a veth pair fails, no error is reported and the control jumps onto cleanup label where some cryptic error message is reported instead (something about inability to remove veth pair). Let's report error that netlink returned - it's probably the most accurate reason anyways. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/225 Signed-off-by: Michal Privoznik --- src/util/virnetdevveth.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c index 7133af44a2..ddf304036a 100644 --- a/src/util/virnetdevveth.c +++ b/src/util/virnetdevveth.c @@ -38,10 +38,17 @@ VIR_LOG_INIT("util.netdevveth"); static int virNetDevVethCreateInternal(const char *veth1, const char *veth2) { - int status; /* Just ignore it */ + int error; virNetlinkNewLinkData data =3D { .veth_peer =3D veth2 }; =20 - return virNetlinkNewLink(veth1, "veth", &data, &status); + if (virNetlinkNewLink(veth1, "veth", &data, &error) < 0) { + virReportSystemError(-error, + _("unable to create %s <-> %s veth pair"), + veth1, veth2); + return -1; + } + + return 0; } =20 static int --=20 2.32.0