1 Star 0 Fork 71

twwang/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
virnetdevbridge-Ignore-EEXIST-when-adding-an-entry-t.patch 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
From 0cd5b4ef642e65e8e8ba35306700e2084a39fdab Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 30 Apr 2021 17:25:29 +0200
Subject: [PATCH 052/108] virnetdevbridge: Ignore EEXIST when adding an entry
to fdb
When updating entries in a bridge forwarding database (i.e., when
macTableManager='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.
https://bugzilla.redhat.com/show_bug.cgi?id=1603155
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
(cherry picked from commit 241c22a9a531cb39d2b6b892561fe856f32f310d)
---
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 e1ba119b8b..49e5f830ea 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -1065,9 +1065,13 @@ virNetDevBridgeFDBAddDel(const virMacAddr *mac, const 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"), ifname);
- return -1;
+ if (isAdd && -err->error == EEXIST) {
+ VIR_DEBUG("fdb entry for %s already exists", ifname);
+ } else {
+ virReportSystemError(-err->error,
+ _("error adding fdb entry for %s"), ifname);
+ return -1;
+ }
}
break;
case NLMSG_DONE:
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/twwang/libvirt.git
git@gitee.com:twwang/libvirt.git
twwang
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385