mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
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.
This commit is contained in:
parent
2398dd3d3e
commit
ee3db56fe9
@ -145,8 +145,10 @@ int virSystemdCreateMachine(const char *name,
|
|||||||
char *username = NULL;
|
char *username = NULL;
|
||||||
char *slicename = NULL;
|
char *slicename = NULL;
|
||||||
|
|
||||||
if (!(conn = virDBusGetSystemBus()))
|
if (!virDBusHasSystemBus())
|
||||||
return -1;
|
return -2;
|
||||||
|
|
||||||
|
conn = virDBusGetSystemBus();
|
||||||
|
|
||||||
if (privileged) {
|
if (privileged) {
|
||||||
if (virAsprintf(&machinename, "%s-%s", drivername, name) < 0)
|
if (virAsprintf(&machinename, "%s-%s", drivername, name) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user