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

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

 



From: Kyle Mestery <kmestery@xxxxxxxxx>

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

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

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 67276f0..abe8ffb 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -333,7 +333,16 @@ qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
             case VIR_NETDEV_VPORT_PROFILE_NONE:
             case VIR_NETDEV_VPORT_PROFILE_8021QBG:
             case VIR_NETDEV_VPORT_PROFILE_8021QBH:
+               break;
             case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
+                if (virNetDevOpenvswitchGetMigrateData(&mig->net[i].portdata,
+                                                       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;
             }
@@ -343,6 +352,7 @@ qemuMigrationCookieNetworkAlloc(struct qemud_driver *driver ATTRIBUTE_UNUSED,
 
 no_memory:
     virReportOOMError();
+error:
     qemuMigrationCookieNetworkFree(mig);
     return NULL;
 }
@@ -1291,8 +1301,8 @@ qemuDomainMigrateOPDRelocate(struct qemud_driver *driver ATTRIBUTE_UNUSED,
                              virDomainObjPtr vm,
                              qemuMigrationCookiePtr cookie)
 {
-    virDomainNetDefPtr netptr ATTRIBUTE_UNUSED;
-    int ret = 0;
+    virDomainNetDefPtr netptr;
+    int ret = -1;
     int i;
 
     for (i = 0; i < cookie->network->nnets; i++) {
@@ -1302,12 +1312,23 @@ qemuDomainMigrateOPDRelocate(struct qemud_driver *driver ATTRIBUTE_UNUSED,
         case VIR_NETDEV_VPORT_PROFILE_NONE:
         case VIR_NETDEV_VPORT_PROFILE_8021QBG:
         case VIR_NETDEV_VPORT_PROFILE_8021QBH:
+           break;
         case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
+            if (virNetDevOpenvswitchSetMigrateData(cookie->network->net[i].portdata,
+                                                   netptr->ifname) != 0) {
+                virReportSystemError(VIR_ERR_INTERNAL_ERROR,
+                                     _("Unable to run command to set OVS port data for "
+                                     "interface %s"), netptr->ifname);
+                goto cleanup;
+            }
+            break;
         default:
             break;
         }
     }
 
+    ret = 0;
+cleanup:
     return ret;
 }
 
-- 
1.7.11.7

--
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]