From nobody Fri Apr 26 22:43:10 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=1619799759; cv=none; d=zohomail.com; s=zohoarc; b=WBNPVpo4zdKn3RLnGj5kWktyp7XqZvkm9ldIGqIVFI111BewL3KwWOfads4mz9YFMR9gm4aTBbXiq4GC2+cK7CPih154kO8QQN5XefOMhtJB1+qt9Q21VO7ECLr4SisLjq1rI3ch+zI7E5Rp6aXwlIui+Bc6eDVEgNdgp2JjBFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619799759; 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=xE4tJWdYMQQVOoZCE4r2JSGSeYGsS8ND4E28PPrskOo=; b=CDGqLDIqXMgYS4kzWn+uLtybsEEANZFYNnkBOko/o7o4CCXLmlG0+1QXU1CFqPfDyD7KG6xtYQMOQnaT9PCAi3+5xgbLZo43lT2iUlzCpiqdAzzOtrI0v7MD2Pj9q+eQVbWl4Xs5pDhsDI2c3JMNXCwkvXYl/zDVT8rYoyeJcRo= 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) header.from= 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 1619799759606366.09581484094406; Fri, 30 Apr 2021 09:22:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-8lWFZvYqMsut8GfmeM4TUw-1; Fri, 30 Apr 2021 12:22:36 -0400 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 D65D5A40C6; Fri, 30 Apr 2021 16:22:30 +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 E31232BFE6; Fri, 30 Apr 2021 16:22:29 +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 38FB91800BB8; Fri, 30 Apr 2021 16:22:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13UGMNfa006119 for ; Fri, 30 Apr 2021 12:22:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id D7514694C9; Fri, 30 Apr 2021 16:22:23 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.40.194.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A65E82B0B3 for ; Fri, 30 Apr 2021 16:22:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id DBD39241252; Fri, 30 Apr 2021 18:22:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619799758; 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=xE4tJWdYMQQVOoZCE4r2JSGSeYGsS8ND4E28PPrskOo=; b=TQnpI3dFO+x745c+sD7H3HTNDK1wZHtOP7UvTrdq0X+Hm+4t31D77GURqtaz2HzzAe0ObJ 4HkPq6kl1sbbFt7rNkQ5NKg2Ul2TEVw9BAF8HY4+LVbpoaEwVEBAPFT/qnETgayu83MsDH GUgoIMb6dLe6vfyRm+HRwQGza08UHdA= X-MC-Unique: 8lWFZvYqMsut8GfmeM4TUw-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] virnetdevbridge: Ignore EEXIST when adding an entry to fdb Date: Fri, 30 Apr 2021 18:22:14 +0200 Message-Id: <2271ce5cad18fcf5b1c4afa6e4cd4d448e764dc7.1619799734.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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) Content-Type: text/plain; charset="utf-8" When updating entries in a bridge forwarding database (i.e., when macTableManager=3D'libvirt' is configured for the bridge), we may end up in a situation when the entry we want to add is already present. Let's just ignore the error in such a case. This fixes an error to resume a domain when fdb entries were not properly removed when the domain was paused: virsh # resume test error: Failed to resume domain test error: error adding fdb entry for vnet2: File exists For some reason, fdb entries are only removed when libvirt explicitly stops CPUs, but nothing happens when we just get STOP event from QEMU. An alternative approach would be to make sure we always remove the entries regardless on why a domain was paused (e.g., during migration), but that would be a significantly more disruptive change with possible side effects. Signed-off-by: Jiri Denemark Reviewed-by: Laine Stump --- src/util/virnetdevbridge.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 7b5ea4fe1d..4fe84cc162 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -1063,9 +1063,13 @@ virNetDevBridgeFDBAddDel(const virMacAddr *mac, cons= t char *ifname, if (resp->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) goto malformed_resp; if (err->error) { - virReportSystemError(-err->error, - _("error adding fdb entry for %s"), ifnam= e); - return -1; + if (isAdd && -err->error =3D=3D EEXIST) { + VIR_DEBUG("fdb entry for %s already exists", ifname); + } else { + virReportSystemError(-err->error, + _("error adding fdb entry for %s"), i= fname); + return -1; + } } break; case NLMSG_DONE: --=20 2.31.1