Skip debug message in lxcContainerSetID if no map is set.

The lxcContainerSetID() method prints a misleading log
message about setting the uid/gid when no ID map is
present in the XML config. Skip the debug message in
this case.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
Chen Hanxiao 2013-10-28 11:18:26 +00:00 committed by Daniel P. Berrange
parent b695aeebd5
commit 8e1336fea9

View File

@ -420,9 +420,11 @@ static int lxcContainerSetID(virDomainDefPtr def)
* for this container. And user namespace is only enabled
* when nuidmap&ngidmap is not zero */
VIR_DEBUG("Set UID/GID to 0/0");
if (def->idmap.nuidmap &&
virSetUIDGID(0, 0, NULL, 0) < 0) {
if (!def->idmap.nuidmap)
return 0;
VIR_DEBUG("Setting UID/GID to 0/0");
if (virSetUIDGID(0, 0, NULL, 0) < 0) {
virReportSystemError(errno, "%s",
_("setuid or setgid failed"));
return -1;