]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu,util: fix netlink callback registration for migration
authorD. Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
Thu, 29 Mar 2012 11:15:00 +0000 (13:15 +0200)
committerLaine Stump <laine@laine.org>
Thu, 12 Apr 2012 18:32:10 +0000 (14:32 -0400)
This patch adds a netlink callback when migrating a VEPA enabled
virtual machine.  It fixes a Bug where a VM would not request a port
association when it was cleared by lldpad.

This patch requires the latest git version of lldpad to work.

Signed-off-by: D. Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
src/libvirt_private.syms
src/qemu/qemu_migration.c
src/util/virnetdevmacvlan.c
src/util/virnetdevmacvlan.h

index a90f8a0fa22126e6bb6334d15b22e4d8e1fd2a29..8d29e75842837690acbd6d37268cb90ac7b98207 100644 (file)
@@ -1290,6 +1290,7 @@ virNetDevMacVLanDelete;
 virNetDevMacVLanCreateWithVPortProfile;
 virNetDevMacVLanDeleteWithVPortProfile;
 virNetDevMacVLanRestartWithVPortProfile;
+virNetDevMacVLanVPortProfileRegisterCallback;
 
 
 # virnetdevopenvswitch.h
index c1bb93a908082b84170f757d25d0babcbe4f3134..dc4d616244903b9fbc4f1ad696250e99b4157c28 100644 (file)
@@ -2739,6 +2739,12 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
                 goto err_exit;
             }
             VIR_DEBUG("Port profile Associate succeeded for %s", net->ifname);
+
+            if (virNetDevMacVLanVPortProfileRegisterCallback(net->ifname, net->mac,
+                                                             virDomainNetGetActualDirectDev(net), def->uuid,
+                                                             virDomainNetGetActualVirtPortProfile(net),
+                                                             VIR_NETDEV_VPORT_PROFILE_OP_CREATE))
+                goto err_exit;
         }
         last_good_net = i;
     }
index 17ea883ab086eac1373cb7a56541980a25093bb5..326e29c4abd0221632f7905f2be2fe9e0832c6aa 100644 (file)
@@ -754,7 +754,7 @@ virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED,
     virNetlinkCallbackDataFree((virNetlinkCallbackDataPtr)opaque);
 }
 
-static int
+int
 virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
                                              const unsigned char *macaddress,
                                              const char *linkdev,
@@ -1110,4 +1110,16 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname ATTRIBUTE_UNUS
                          _("Cannot create macvlan devices on this platform"));
     return -1;
 }
+
+int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname ATTRIBUTE_UNUSED,
+                                             const unsigned char *macaddress ATTRIBUTE_UNUSED,
+                                             const char *linkdev ATTRIBUTE_UNUSED,
+                                             const unsigned char *vmuuid ATTRIBUTE_UNUSED,
+                                             virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
+                                             enum virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED)
+{
+    virReportSystemError(ENOSYS, "%s",
+                         _("Cannot create macvlan devices on this platform"));
+    return -1;
+}
 #endif /* ! WITH_MACVTAP */
index 14640cf82af46bb70916702a1dce31bfffd9a4bc..2299f1d00bf49f2ab8f81ac5d1b1a69a42140929 100644 (file)
@@ -84,4 +84,12 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
 
+int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
+                                             const unsigned char *macaddress ,
+                                             const char *linkdev,
+                                             const unsigned char *vmuuid,
+                                             virNetDevVPortProfilePtr virtPortProfile,
+                                             enum virNetDevVPortProfileOp vmOp)
+ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK;
 #endif /* __UTIL_MACVTAP_H__ */