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

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



On 08/25/2011 04:35 AM, Jiri Denemark wrote:
---
  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..d787a09 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);

Unconditional, changed to...

+        if (virSecurityManagerSetImageFDLabel(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);

...conditional.  Oops - you leak the fd if changing the label fails.

Needs a v2.

--
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


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