VirtualBox

Changeset 55602 in vbox


Ignore:
Timestamp:
May 2, 2015 10:12:13 AM (9 years ago)
Author:
vboxsync
Message:

Main/Linux/HostPower: add DBus-based host suspend and resume notifications.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dbus-calls.h

    r44529 r55602  
    125125                  DBusHandleMessageFunction function, void *pvoid), \
    126126                 (connection, function, pvoid)) \
     127 RT_PROXY_STUB(dbus_connection_read_write, dbus_bool_t, \
     128                 (DBusConnection *connection, int val), (connection, val)) \
    127129 RT_PROXY_STUB(dbus_connection_read_write_dispatch, dbus_bool_t, \
    128130                 (DBusConnection *connection, int val), (connection, val)) \
  • trunk/src/VBox/Main/Makefile.kmk

    r55436 r55602  
    430430        src-server/linux/HostHardwareLinux.cpp \
    431431        src-server/linux/HostDnsServiceLinux.cpp \
     432        src-server/linux/HostPowerLinux.cpp \
    432433        src-server/HostDnsServiceResolvConf.cpp
    433434
  • trunk/src/VBox/Main/include/HostPower.h

    r55436 r55602  
    2323
    2424#include <vector>
     25
     26#ifdef RT_OS_LINUX
     27# include <VBox/dbus.h>
     28#endif
    2529
    2630#ifdef RT_OS_DARWIN
     
    6064    RTTHREAD    mThread;
    6165};
     66#elif defined(RT_OS_LINUX)
     67/**
     68 * The Linux hosted Power Service.
     69 */
     70class HostPowerServiceLinux : public HostPowerService
     71{
     72public:
     73
     74    HostPowerServiceLinux(VirtualBox *aVirtualBox);
     75    virtual ~HostPowerServiceLinux();
     76
     77private:
     78
     79    static DECLCALLBACK(int) powerChangeNotificationThread(RTTHREAD ThreadSelf, void *pInstance);
     80
     81    /* Private member vars */
     82    /** Our message thread. */
     83    RTTHREAD mThread;
     84    /** Our (private) connection to the DBus.  Closing this will cause the
     85     * message thread to exit. */
     86    DBusConnection *mpConnection;
     87};
     88
    6289# elif defined(RT_OS_DARWIN) /* RT_OS_WINDOWS */
    6390/**
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r55457 r55602  
    304304#if defined(RT_OS_WINDOWS)
    305305    m->pHostPowerService = new HostPowerServiceWin(m->pParent);
     306#elif defined(RT_OS_LINUX)
     307    m->pHostPowerService = new HostPowerServiceLinux(m->pParent);
    306308#elif defined(RT_OS_DARWIN)
    307309    m->pHostPowerService = new HostPowerServiceDarwin(m->pParent);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette