[PATCH] util: only register callbacks for CREATE operations in virnetdevmacvlan.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "D. Herrendoerfer" <d.herrendoerfer@xxxxxxxxxxxxxxxxxx>

currently upon a migration a callback is created when a 802.1qbg link
is set to PREASSOCIATE, this should not happen because this is
a no-op on most switches, and does not lead to an ASSOCIATE state.
This patch only creates callbacks when CREATE is requested.
Migration and libvirtd restart scenarios are already handeled elsewhere.

Signed-off-by: D. Herrendoerfer <d.herrendoerfer@xxxxxxxxxxxxxxxxxx>
---
 src/util/virnetdevmacvlan.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 17ea883..73f41ff 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -945,9 +945,12 @@ create_name:
         goto disassociate_exit;
     }
 
-    if (virNetDevMacVLanVPortProfileRegisterCallback(cr_ifname, macaddress,
-                                         linkdev, vmuuid, virtPortProfile, vmOp) < 0 )
+    if (vmOp == VIR_NETDEV_VPORT_PROFILE_OP_CREATE) {
+        /*Only directly register upon a create - migration and restart are handled elsewhere*/
+        if (virNetDevMacVLanVPortProfileRegisterCallback(cr_ifname, macaddress,
+                                                         linkdev, vmuuid, virtPortProfile, vmOp) < 0 )
         goto disassociate_exit;
+    }
 
     return rc;
 
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]