As a side effect, this also silences the possible:
internal error: Unable to get DBus system bus connection:
Failed to connect to socket /run/dbus/system_bus_socket:
No such file or directory
error, since we check upfront whether dbus is available.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
virSystemdCreateMachine;
virSystemdGetActivation;
virSystemdGetMachineNameByPID;
+virSystemdHasLogind;
virSystemdHasLogindResetCachedValue;
virSystemdHasMachinedResetCachedValue;
virSystemdMakeScopeName;
VIR_DEBUG("dmn=%p what=%s who=%s why=%s mode=%s",
dmn, NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode));
+ if (virSystemdHasLogind() < 0)
+ return;
+
if (!(systemBus = virDBusGetSystemBus()))
return;
return ret;
}
-static int
+int
virSystemdHasLogind(void)
{
int ret;
void virSystemdNotifyStartup(void);
+int virSystemdHasLogind(void);
+
int virSystemdCanSuspend(bool *result);
int virSystemdCanHibernate(bool *result);