Fix conditional check for DBus

The DBus conditional was renamed way back:

  commit da77f04ed5fa0731d50b947be8c739bdbf8121ad
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Thu Sep 20 15:05:39 2012 +0100

    Convert HAVE_DBUS to WITH_DBUS

but the shutdown inhibit code was not updated. Thus libvirt
was never inhibiting shutdown by a logged in user when VMs
are running.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2017-06-23 16:20:11 +01:00
parent b49825584a
commit 3e03d1bd7e
2 changed files with 4 additions and 4 deletions

View File

@ -795,7 +795,7 @@ static void daemonInhibitCallback(bool inhibit, void *opaque)
}
#ifdef HAVE_DBUS
#ifdef WITH_DBUS
static DBusConnection *sessionBus;
static DBusConnection *systemBus;
@ -887,7 +887,7 @@ static void daemonRunStateInit(void *opaque)
driversInitialized = true;
#ifdef HAVE_DBUS
#ifdef WITH_DBUS
/* Tie the non-privileged libvirtd to the session/shutdown lifecycle */
if (!virNetDaemonIsPrivileged(dmn)) {

View File

@ -437,7 +437,7 @@ virNetDaemonAutoShutdown(virNetDaemonPtr dmn,
}
#if defined(HAVE_DBUS) && defined(DBUS_TYPE_UNIX_FD)
#if defined(WITH_DBUS) && defined(DBUS_TYPE_UNIX_FD)
static void
virNetDaemonGotInhibitReply(DBusPendingCall *pending,
void *opaque)
@ -529,7 +529,7 @@ virNetDaemonAddShutdownInhibition(virNetDaemonPtr dmn)
VIR_DEBUG("dmn=%p inhibitions=%zu", dmn, dmn->autoShutdownInhibitions);
#if defined(HAVE_DBUS) && defined(DBUS_TYPE_UNIX_FD)
#if defined(WITH_DBUS) && defined(DBUS_TYPE_UNIX_FD)
if (dmn->autoShutdownInhibitions == 1)
virNetDaemonCallInhibit(dmn,
"shutdown",