[PATCH 19/21] qemu: migration: dest: qemuMigrationOpenNBDTunnel

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

 



Add qemuMigrationOpenNBDTunnel that connects a remote stream to the
local NBD UNIX socket.

Signed-off-by: Pavel Boldin <pboldin@xxxxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 4708387..27c1acb 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3605,6 +3605,32 @@ qemuMigrationPrepareTunnel(virQEMUDriverPtr driver,
 }
 
 
+static int
+qemuMigrationOpenNBDTunnel(virQEMUDriverPtr driver,
+                           virStreamPtr st,
+                           const char *name)
+{
+    char *tunnelName = NULL;
+    int ret = -1;
+    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+
+    if (virAsprintf(&tunnelName,
+                    "%s/domain-%s/qemu.nbdtunnelmigrate.src",
+                    cfg->libDir, name) < 0)
+        goto cleanup;
+
+    if (virFDStreamConnectUNIX(st, tunnelName, false) < 0)
+        goto cleanup;
+
+    ret = 0;
+
+ cleanup:
+    VIR_FREE(tunnelName);
+    virObjectUnref(cfg);
+    return ret;
+}
+
+
 int
 qemuMigrationOpenTunnel(virQEMUDriverPtr driver,
                         virConnectPtr dconn,
@@ -3621,6 +3647,9 @@ qemuMigrationOpenTunnel(virQEMUDriverPtr driver,
         return -1;
     }
 
+    if (flags & VIR_MIGRATE_TUNNEL_NBD)
+        return qemuMigrationOpenNBDTunnel(driver, st, def->name);
+
     return 0;
 }
 
-- 
1.9.1

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