diff --git a/src/Makefile.am b/src/Makefile.am index 201c26816d..e58d4086c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2381,6 +2381,7 @@ libvirt_lxc_CFLAGS = \ $(PIE_CFLAGS) \ $(LIBNL_CFLAGS) \ $(FUSE_CFLAGS) \ + $(DBUS_CFLAGS) \ $(NULL) if WITH_BLKID libvirt_lxc_CFLAGS += $(BLKID_CFLAGS) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index bb33c2823c..b881f172de 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -64,6 +64,7 @@ #include "virrandom.h" #include "virprocess.h" #include "virnuma.h" +#include "virdbus.h" #include "rpc/virnetserver.h" #include "virstring.h" @@ -2200,6 +2201,12 @@ virLXCControllerRun(virLXCControllerPtr ctrl) if (virLXCControllerConsoleSetNonblocking(&(ctrl->consoles[i])) < 0) goto cleanup; + /* 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 + */ + virDBusCloseSystemBus(); + rc = virLXCControllerMain(ctrl); virLXCControllerEventSendExit(ctrl, rc); @@ -2351,6 +2358,8 @@ int main(int argc, char *argv[]) virEventRegisterDefaultImpl(); + virDBusSetSharedBus(false); + if (!(ctrl = virLXCControllerNew(name))) goto cleanup;