[PATCH v2] qemu: Correctly label migration TCP socket passed to qemu

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

 



---
Notes:
    Version 2:
    - use virSecurityManagerSetProcessFDLabel instead of
      virSecurityManagerSetImageFDLabel since the correct label for
      TCP sockets appears to be svirt_t and not svirt_image_t

 src/qemu/qemu_migration.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a84faf6..8e24199 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1484,9 +1484,12 @@ qemuMigrationRun(struct qemud_driver *driver,
     case MIGRATION_DEST_FD:
         if (spec->fwdType != MIGRATION_FWD_DIRECT)
             fd = spec->dest.fd.local;
-        ret = qemuMonitorMigrateToFd(priv->mon, migrate_flags,
-                                     spec->dest.fd.qemu);
-        VIR_FORCE_CLOSE(spec->dest.fd.qemu);
+        if (virSecurityManagerSetProcessFDLabel(driver->securityManager, vm,
+                                                spec->dest.fd.qemu) == 0) {
+            ret = qemuMonitorMigrateToFd(priv->mon, migrate_flags,
+                                         spec->dest.fd.qemu);
+            VIR_FORCE_CLOSE(spec->dest.fd.qemu);
+        }
         break;
     }
     qemuDomainObjExitMonitorWithDriver(driver, vm);
-- 
1.7.6.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]