mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add some misc debugging to LXC startup
Add some debug logging of LXC wait/continue messages and uid/gid map update code.
This commit is contained in:
parent
293f717028
commit
1165e39ca3
@ -294,6 +294,7 @@ int lxcContainerSendContinue(int control)
|
|||||||
lxc_message_t msg = LXC_CONTINUE_MSG;
|
lxc_message_t msg = LXC_CONTINUE_MSG;
|
||||||
int writeCount = 0;
|
int writeCount = 0;
|
||||||
|
|
||||||
|
VIR_DEBUG("Send continue on fd %d", control);
|
||||||
writeCount = safewrite(control, &msg, sizeof(msg));
|
writeCount = safewrite(control, &msg, sizeof(msg));
|
||||||
if (writeCount != sizeof(msg)) {
|
if (writeCount != sizeof(msg)) {
|
||||||
goto error_out;
|
goto error_out;
|
||||||
@ -319,7 +320,9 @@ int lxcContainerWaitForContinue(int control)
|
|||||||
lxc_message_t msg;
|
lxc_message_t msg;
|
||||||
int readLen;
|
int readLen;
|
||||||
|
|
||||||
|
VIR_DEBUG("Wait continue on fd %d", control);
|
||||||
readLen = saferead(control, &msg, sizeof(msg));
|
readLen = saferead(control, &msg, sizeof(msg));
|
||||||
|
VIR_DEBUG("Got continue on fd %d %d", control, readLen);
|
||||||
if (readLen != sizeof(msg)) {
|
if (readLen != sizeof(msg)) {
|
||||||
if (readLen >= 0)
|
if (readLen >= 0)
|
||||||
errno = EIO;
|
errno = EIO;
|
||||||
@ -348,6 +351,7 @@ static int lxcContainerSetID(virDomainDefPtr def)
|
|||||||
* for this container. And user namespace is only enabled
|
* for this container. And user namespace is only enabled
|
||||||
* when nuidmap&ngidmap is not zero */
|
* when nuidmap&ngidmap is not zero */
|
||||||
|
|
||||||
|
VIR_DEBUG("Set UID/GID to 0/0");
|
||||||
if (def->idmap.nuidmap && virSetUIDGID(0, 0) < 0) {
|
if (def->idmap.nuidmap && virSetUIDGID(0, 0) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("setuid or setgid failed"));
|
_("setuid or setgid failed"));
|
||||||
|
@ -1158,6 +1158,8 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
|
|||||||
if (virBufferError(&map_value))
|
if (virBufferError(&map_value))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
|
VIR_DEBUG("Set '%s' to '%s'", path, virBufferCurrentContent(&map_value));
|
||||||
|
|
||||||
if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
|
if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
|
||||||
virReportSystemError(errno, _("unable write to %s"), path);
|
virReportSystemError(errno, _("unable write to %s"), path);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user