Changeset 43656 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 16, 2012 3:18:28 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 81422
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStop.cpp
r43378 r43656 158 158 CHECK_ERROR_BREAK(machine, COMGETTER(State)(&enmMachineState)); 159 159 160 /* Wait until the VM changes from a transient state back. */ 161 while ( enmMachineState >= MachineState_FirstTransient 162 && enmMachineState <= MachineState_LastTransient) 163 { 164 RTThreadSleep(1000); 165 CHECK_ERROR_BREAK(machine, COMGETTER(State)(&enmMachineState)); 166 } 167 160 168 /* Only power off running machines. */ 161 /** @todo: What about transient VM states? */162 169 if ( enmMachineState == MachineState_Running 163 170 || enmMachineState == MachineState_Paused) 164 171 { 165 ComPtr<IMachine> sessionMachine;166 172 ComPtr<IConsole> console; 167 173 ComPtr<IProgress> progress; … … 172 178 /* get the associated console */ 173 179 CHECK_ERROR_BREAK(g_pSession, COMGETTER(Console)(console.asOutParam())); 174 CHECK_ERROR_BREAK(g_pSession, COMGETTER(Machine)(sessionMachine.asOutParam()));175 180 176 181 switch ((*it).enmAutostopType) … … 194 199 BOOL fGuestEnteredACPI = false; 195 200 CHECK_ERROR_BREAK(console, GetGuestEnteredACPIMode(&fGuestEnteredACPI)); 196 if (fGuestEnteredACPI) 201 if (fGuestEnteredACPI && enmMachineState == MachineState_Running) 202 { 197 203 CHECK_ERROR_BREAK(console, PowerButton()); 204 205 serviceLog("Waiting for VM \"%ls\" to power off...\n", (*it).strId.raw()); 206 207 do 208 { 209 RTThreadSleep(1000); 210 CHECK_ERROR_BREAK(machine, COMGETTER(State)(&enmMachineState)); 211 } while (enmMachineState == MachineState_Running); 212 } 198 213 else 199 214 { 200 215 /* Use save state instead and log this to the console. */ 201 serviceLog("The guest of VM \"%ls\" does not support ACPI shutdown , saving state...\n",216 serviceLog("The guest of VM \"%ls\" does not support ACPI shutdown or is currently paused, saving state...\n", 202 217 (*it).strId.raw()); 203 218 rc = autostartSaveVMState(console); … … 208 223 serviceLog("Unknown autostop type for VM \"%ls\"\n", (*it).strId.raw()); 209 224 } 210 }211 g_pSession->UnlockMachine();225 g_pSession->UnlockMachine(); 226 } 212 227 } 213 228 }
Note:
See TracChangeset
for help on using the changeset viewer.