mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 03:21:19 +00:00
rpc: make virNetDaemonCallInhibit a no-op with no logind
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>
This commit is contained in:
parent
dd16434a2a
commit
257f96eb1e
@ -3135,6 +3135,7 @@ virSystemdCanSuspend;
|
|||||||
virSystemdCreateMachine;
|
virSystemdCreateMachine;
|
||||||
virSystemdGetActivation;
|
virSystemdGetActivation;
|
||||||
virSystemdGetMachineNameByPID;
|
virSystemdGetMachineNameByPID;
|
||||||
|
virSystemdHasLogind;
|
||||||
virSystemdHasLogindResetCachedValue;
|
virSystemdHasLogindResetCachedValue;
|
||||||
virSystemdHasMachinedResetCachedValue;
|
virSystemdHasMachinedResetCachedValue;
|
||||||
virSystemdMakeScopeName;
|
virSystemdMakeScopeName;
|
||||||
|
@ -508,6 +508,9 @@ virNetDaemonCallInhibit(virNetDaemonPtr dmn,
|
|||||||
VIR_DEBUG("dmn=%p what=%s who=%s why=%s mode=%s",
|
VIR_DEBUG("dmn=%p what=%s who=%s why=%s mode=%s",
|
||||||
dmn, NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode));
|
dmn, NULLSTR(what), NULLSTR(who), NULLSTR(why), NULLSTR(mode));
|
||||||
|
|
||||||
|
if (virSystemdHasLogind() < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!(systemBus = virDBusGetSystemBus()))
|
if (!(systemBus = virDBusGetSystemBus()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ virSystemdHasMachined(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
virSystemdHasLogind(void)
|
virSystemdHasLogind(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -57,6 +57,8 @@ int virSystemdTerminateMachine(const char *name);
|
|||||||
|
|
||||||
void virSystemdNotifyStartup(void);
|
void virSystemdNotifyStartup(void);
|
||||||
|
|
||||||
|
int virSystemdHasLogind(void);
|
||||||
|
|
||||||
int virSystemdCanSuspend(bool *result);
|
int virSystemdCanSuspend(bool *result);
|
||||||
|
|
||||||
int virSystemdCanHibernate(bool *result);
|
int virSystemdCanHibernate(bool *result);
|
||||||
|
Loading…
Reference in New Issue
Block a user