mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +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;
|
||||
virSystemdGetActivation;
|
||||
virSystemdGetMachineNameByPID;
|
||||
virSystemdHasLogind;
|
||||
virSystemdHasLogindResetCachedValue;
|
||||
virSystemdHasMachinedResetCachedValue;
|
||||
virSystemdMakeScopeName;
|
||||
|
@ -508,6 +508,9 @@ virNetDaemonCallInhibit(virNetDaemonPtr dmn,
|
||||
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;
|
||||
|
||||
|
@ -181,7 +181,7 @@ virSystemdHasMachined(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
virSystemdHasLogind(void)
|
||||
{
|
||||
int ret;
|
||||
|
@ -57,6 +57,8 @@ int virSystemdTerminateMachine(const char *name);
|
||||
|
||||
void virSystemdNotifyStartup(void);
|
||||
|
||||
int virSystemdHasLogind(void);
|
||||
|
||||
int virSystemdCanSuspend(bool *result);
|
||||
|
||||
int virSystemdCanHibernate(bool *result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user