VirtualBox

Changeset 50216 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Jan 24, 2014 11:32:03 AM (11 years ago)
Author:
vboxsync
Message:

Main/HostPower: s/HostPower\/SavestateOnBatteryLow/VBoxInternal2\/SavestateOnBatteryLow/ + handle runtime changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostPower.cpp

    r50175 r50216  
    3636    AssertPtr(aVirtualBox);
    3737    mVirtualBox = aVirtualBox;
    38 
    39     // keep this in sync with the host-specific implementations
    40 #if defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
    41     Bstr bstrValue;
    42     HRESULT hrc = mVirtualBox->GetExtraData(Bstr("HostPower/SavestateOnBatteryLow").raw(),
    43                                             bstrValue.asOutParam());
    44     if (   SUCCEEDED(hrc)
    45         && (   bstrValue.isEmpty()
    46             || bstrValue != "0"))
    47     {
    48         fSavestateOnBatteryLow = true;
    49         LogRel(("Power: BatteryLow event will trigger VM savestate\n"));
    50     }
    51     else
    52 #endif
    53     {
    54         fSavestateOnBatteryLow = false;
    55         LogRel(("Power: BatteryLow will be ignored\n"));
    56     }
    5738}
    5839
     
    142123        case Reason_HostBatteryLow:
    143124        {
    144             if (fSavestateOnBatteryLow)
     125            Bstr value;
     126            HRESULT hrc = mVirtualBox->GetExtraData(Bstr("VBoxInternal2/SavestateOnBatteryLow").raw(),
     127                                                         value.asOutParam());
     128            if (   SUCCEEDED(hrc)
     129                && value != "0")
    145130            {
    146131                LogFunc(("BATTERY LOW -- savestate running VMs\n"));
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