writeCount = safewrite(control, &msg, sizeof(msg));
if (writeCount != sizeof(msg)) {
- virReportSystemError(errno, "%s",
- _("Unable to send container continue message"));
goto error_out;
}
rc = 0;
-
error_out:
return rc;
}
readLen = saferead(control, &msg, sizeof(msg));
if (readLen != sizeof(msg) ||
msg != LXC_CONTINUE_MSG) {
- virReportSystemError(errno, "%s",
- _("Failed to read the container continue message"));
return -1;
}
- VIR_FORCE_CLOSE(control);
-
- VIR_DEBUG("Received container continue message");
return 0;
}
goto cleanup;
/* Wait for interface devices to show up */
- if (lxcContainerWaitForContinue(argv->monitor) < 0)
+ if (lxcContainerWaitForContinue(argv->monitor) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Failed to read the container continue message"));
goto cleanup;
+ }
+ VIR_DEBUG("Received container continue message");
/* rename and enable interfaces */
if (lxcContainerRenameAndEnableInterfaces(argv->nveths,
cleanup:
VIR_FREE(ttyPath);
VIR_FORCE_CLOSE(ttyfd);
+ VIR_FORCE_CLOSE(argv->monitor);
if (ret == 0) {
/* this function will only return if an error occured */
if (lxcControllerMoveInterfaces(nveths, veths, container) < 0)
goto cleanup;
- if (lxcContainerSendContinue(control[0]) < 0)
+ if (lxcContainerSendContinue(control[0]) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to send container continue message"));
goto cleanup;
+ }
/* Now the container is running, there's no need for us to keep
any elevated capabilities */