]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc_controller: Move closing of handshakeFd out of virLXCControllerDaemonHandshake()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Apr 2021 11:34:55 +0000 (13:34 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 22 Apr 2021 11:53:05 +0000 (13:53 +0200)
Future commits will want to reuse the handshakeFd and thus it
mustn't be closed in virLXCControllerDaemonHandshake(). Do the
closing explicitly afterwards.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_controller.c

index 50b2987d9ad3623fc3f9d0397904aa7653063a62..797547b05c23469c67afd0e768184c27588b82a9 100644 (file)
@@ -353,7 +353,6 @@ static int virLXCControllerDaemonHandshake(virLXCController *ctrl)
                              _("error sending continue signal to daemon"));
         return -1;
     }
-    VIR_FORCE_CLOSE(ctrl->handshakeFd);
     return 0;
 }
 
@@ -2403,6 +2402,9 @@ virLXCControllerRun(virLXCController *ctrl)
     if (virLXCControllerDaemonHandshake(ctrl) < 0)
         goto cleanup;
 
+    /* and preemptively close handshakeFd */
+    VIR_FORCE_CLOSE(ctrl->handshakeFd);
+
     /* We must not hold open a dbus connection for life
      * of LXC instance, since dbus-daemon is limited to
      * only a few 100 connections by default