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

[libvirt] [PATCH 3/3] qemu_migration: Transport OVS per-port data during live migration



Transport Open vSwitch per-port data during live
migration by using the utility functions
virNetDevOpenvswitchGetMigrateData() and
virNetDevOpenvswitchSetMigrateData().

Signed-off-by: Kyle Mestery <kmestery cisco com>
---
 src/qemu/qemu_migration.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 539b361..50884c8 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -308,7 +308,7 @@ qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
 {
     qemuMigrationCookieNetworkPtr mig;
     int i;
-    virDomainNetDefPtr netptr ATTRIBUTE_UNUSED;
+    virDomainNetDefPtr netptr;
 
     if (VIR_ALLOC(mig) < 0)
         goto no_memory;
@@ -339,6 +339,13 @@ qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
             case VIR_NETDEV_VPORT_PROFILE_8021QBH:
                 break;
             case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
+                if (virNetDevOpenvswitchGetMigrateData(&mig->netdata[i],
+                                                       netptr->ifname) != 0) {
+                    virReportSystemError(VIR_ERR_INTERNAL_ERROR,
+                                         _("Unable to run command to get OVS port data for "
+                                         "interface %s"), netptr->ifname);
+                    goto error;
+                }
                 break;
             default:
                 break;
@@ -346,6 +353,7 @@ qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
         }
     }
 
+error:
     return mig;
 
 no_memory:
@@ -1275,7 +1283,7 @@ qemuDomainMigrateOPDRelocate(struct qemud_driver *driver ATTRIBUTE_UNUSED,
                              virDomainObjPtr vm,
                              qemuMigrationCookiePtr cookie)
 {
-    virDomainNetDefPtr netptr ATTRIBUTE_UNUSED;
+    virDomainNetDefPtr netptr;
     int ret = 0;
     int i;
 
@@ -1290,12 +1298,23 @@ qemuDomainMigrateOPDRelocate(struct qemud_driver *driver ATTRIBUTE_UNUSED,
         case VIR_NETDEV_VPORT_PROFILE_8021QBH:
             break;
         case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
+            VIR_ERROR(_("KM-> Setting OVS data (%s)"), cookie->network->netdata[i]);
+            if (virNetDevOpenvswitchSetMigrateData(cookie->network->netdata[i],
+                                                   netptr->ifname) != 0) {
+                virReportSystemError(VIR_ERR_INTERNAL_ERROR,
+                                     _("Unable to run command to set OVS port data for "
+                                     "interface %s"), netptr->ifname);
+                ret = -1;
+                goto error;
+            }
+
             break;
         default:
             break;
         }
     }
 
+error:
     return ret;
 }
 
-- 
1.7.11.4


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