From: Peter Krempa Date: Mon, 19 Aug 2013 09:34:39 +0000 (+0200) Subject: virsystemd: Don't fail to start VM if DBus isn't available or compiled in X-Git-Tag: v1.1.2-rc1~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee3db56fe9d47f547c07e7e0f6475e7f7a0eea7f;p=thirdparty%2Flibvirt.git virsystemd: Don't fail to start VM if DBus isn't available or compiled in On hosts that don't have the DBus service running or installed the new systemd cgroups code failed with hard error instead of falling back to "manual" cgroup creation. Use the new helper to check for the system bus and use the fallback code in case it isn't available. --- diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 251b8463ff..3e69ef6679 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -145,8 +145,10 @@ int virSystemdCreateMachine(const char *name, char *username = NULL; char *slicename = NULL; - if (!(conn = virDBusGetSystemBus())) - return -1; + if (!virDBusHasSystemBus()) + return -2; + + conn = virDBusGetSystemBus(); if (privileged) { if (virAsprintf(&machinename, "%s-%s", drivername, name) < 0)