Changeset 44393 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Jan 25, 2013 9:21:05 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83364
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r44374 r44393 3899 3899 { 3900 3900 /* too bad, we failed. try to sync the console state with the VMM state */ 3901 vmstateChangeCallback( VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);3901 vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole); 3902 3902 } 3903 3903 /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume … … 4144 4144 { 4145 4145 /* too bad, we failed. try to sync the console state with the VMM state */ 4146 vmstateChangeCallback( VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);4147 } 4148 /** @todo :if we failed with drive mount, then the VMR3Resume4146 vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole); 4147 } 4148 /** @todo if we failed with drive mount, then the VMR3Resume 4149 4149 * error (if any) will be hidden from the caller. For proper reporting 4150 4150 * of such multiple errors to the caller we need to enhance the … … 4397 4397 { 4398 4398 /* too bad, we failed. try to sync the console state with the VMM state */ 4399 vmstateChangeCallback( VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pConsole);4399 vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pConsole); 4400 4400 } 4401 4401 /** @todo: if we failed with drive mount, then the VMR3Resume … … 4775 4775 { 4776 4776 /* too bad, we failed. try to sync the console state with the VMM state */ 4777 vmstateChangeCallback( VMR3GetVM(pUVM), VMSTATE_SUSPENDED, enmVMState, pThis);4777 vmstateChangeCallback(pUVM, VMSTATE_SUSPENDED, enmVMState, pThis); 4778 4778 } 4779 4779 /// @todo (r=dmik) if we failed with drive mount, then the VMR3Resume … … 5751 5751 /* too bad, we failed. try to sync the console state with the VMM state */ 5752 5752 AssertLogRelRC(vrc2); 5753 vmstateChangeCallback(ptrVM.raw (), VMSTATE_SUSPENDED, enmVMState, this);5753 vmstateChangeCallback(ptrVM.rawUVM(), VMSTATE_SUSPENDED, enmVMState, this); 5754 5754 } 5755 5755 } … … 5827 5827 { 5828 5828 /* too bad, we failed. try to sync the console state with the VMM state */ 5829 vmstateChangeCallback(ptrVM.raw (), VMSTATE_SUSPENDED, enmVMState, this);5829 vmstateChangeCallback(ptrVM.rawUVM(), VMSTATE_SUSPENDED, enmVMState, this); 5830 5830 } 5831 5831 } … … 7496 7496 } 7497 7497 7498 /** 7499 * VM state callback function. Called by the VMM 7500 * using its state machine states. 7501 * 7502 * Primarily used to handle VM initiated power off, suspend and state saving, 7503 * but also for doing termination completed work (VMSTATE_TERMINATE). 7504 * 7505 * In general this function is called in the context of the EMT. 7506 * 7507 * @param aVM The VM handle. 7508 * @param aState The new state. 7509 * @param aOldState The old state. 7510 * @param aUser The user argument (pointer to the Console object). 7511 * 7512 * @note Locks the Console object for writing. 7498 /** @callback_method_impl{FNVMATSTATE} 7499 * 7500 * @note Locks the Console object for writing. 7501 * @remarks The @a pUVM parameter can be NULL in one case where powerUpThread() 7502 * calls after the VM was destroyed. 7513 7503 */ 7514 DECLCALLBACK(void) Console::vmstateChangeCallback(PVM aVM, 7515 VMSTATE aState, 7516 VMSTATE aOldState, 7517 void *aUser) 7518 { 7519 LogFlowFunc(("Changing state from %s to %s (aVM=%p)\n", 7520 VMR3GetStateName(aOldState), VMR3GetStateName(aState), aVM)); 7521 7522 Console *that = static_cast<Console *>(aUser); 7504 DECLCALLBACK(void) Console::vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser) 7505 { 7506 LogFlowFunc(("Changing state from %s to %s (pUVM=%p)\n", 7507 VMR3GetStateName(enmOldState), VMR3GetStateName(enmState), pUVM)); 7508 7509 Console *that = static_cast<Console *>(pvUser); 7523 7510 AssertReturnVoid(that); 7524 7511 … … 7532 7519 || autoCaller.state() == InUninit); 7533 7520 7534 switch ( aState)7521 switch (enmState) 7535 7522 { 7536 7523 /* … … 7620 7607 break; 7621 7608 7622 /* Terminate host interface networking. If aVM is NULL, we've been7609 /* Terminate host interface networking. If pUVM is NULL, we've been 7623 7610 * manually called from powerUpThread() either before calling 7624 7611 * VMR3Create() or after VMR3Create() failed, so no need to touch 7625 7612 * networking. 7626 7613 */ 7627 if ( aVM)7614 if (pUVM) 7628 7615 that->powerDownHostInterfaces(); 7629 7616 … … 7740 7727 7741 7728 default: 7742 AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName( aOldState), VMR3GetStateName(aState) ));7729 AssertMsgFailed(("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7743 7730 that->setMachineState(MachineState_Paused); 7744 7731 break; … … 7749 7736 case VMSTATE_RUNNING: 7750 7737 { 7751 if ( aOldState == VMSTATE_POWERING_ON7752 || aOldState == VMSTATE_RESUMING7753 || aOldState == VMSTATE_RUNNING_FT)7738 if ( enmOldState == VMSTATE_POWERING_ON 7739 || enmOldState == VMSTATE_RESUMING 7740 || enmOldState == VMSTATE_RUNNING_FT) 7754 7741 { 7755 7742 AutoWriteLock alock(that COMMA_LOCKVAL_SRC_POS); … … 7760 7747 Assert( ( ( that->mMachineState == MachineState_Starting 7761 7748 || that->mMachineState == MachineState_Paused) 7762 && aOldState == VMSTATE_POWERING_ON)7749 && enmOldState == VMSTATE_POWERING_ON) 7763 7750 || ( ( that->mMachineState == MachineState_Restoring 7764 7751 || that->mMachineState == MachineState_TeleportingIn … … 7766 7753 || that->mMachineState == MachineState_Saving 7767 7754 ) 7768 && aOldState == VMSTATE_RESUMING)7755 && enmOldState == VMSTATE_RESUMING) 7769 7756 || ( that->mMachineState == MachineState_FaultTolerantSyncing 7770 && aOldState == VMSTATE_RUNNING_FT));7757 && enmOldState == VMSTATE_RUNNING_FT)); 7771 7758 7772 7759 that->setMachineState(MachineState_Running); … … 7779 7766 AssertMsg( that->mMachineState == MachineState_LiveSnapshotting 7780 7767 || that->mMachineState == MachineState_Teleporting, 7781 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName( aOldState), VMR3GetStateName(aState) ));7768 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7782 7769 break; 7783 7770 7784 7771 case VMSTATE_RUNNING_FT: 7785 7772 AssertMsg(that->mMachineState == MachineState_FaultTolerantSyncing, 7786 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName( aOldState), VMR3GetStateName(aState) ));7773 ("%s/%s -> %s\n", Global::stringifyMachineState(that->mMachineState), VMR3GetStateName(enmOldState), VMR3GetStateName(enmState) )); 7787 7774 break; 7788 7775 … … 8408 8395 * and VMR3Teleport. 8409 8396 * 8410 * @param p VM The VM handle.8397 * @param pUVM The user mode VM handle. 8411 8398 * @param uPercent Completion percentage (0-100). 8412 8399 * @param pvUser Pointer to an IProgress instance. … … 8414 8401 */ 8415 8402 /*static*/ 8416 DECLCALLBACK(int) Console::stateProgressCallback(P VM pVM, unsigned uPercent, void *pvUser)8403 DECLCALLBACK(int) Console::stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser) 8417 8404 { 8418 8405 IProgress *pProgress = static_cast<IProgress *>(pvUser); … … 8422 8409 pProgress->SetCurrentOperationProgress(uPercent); 8423 8410 8411 NOREF(pUVM); 8424 8412 return VINF_SUCCESS; 8425 8413 } … … 8432 8420 */ 8433 8421 /*static*/ DECLCALLBACK(void) 8434 Console::genericVMSetErrorCallback(P VM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,8422 Console::genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, 8435 8423 const char *pszErrorFmt, va_list va) 8436 8424 { … … 8450 8438 8451 8439 va_end(va2); 8440 8441 NOREF(pUVM); 8452 8442 } 8453 8443 … … 8456 8446 * See VMSetRuntimeError for the detailed description of parameters. 8457 8447 * 8458 * @param pVM The VM handle. Ignored, so passing NULL is fine. 8448 * @param pUVM The user mode VM handle. Ignored, so passing NULL 8449 * is fine. 8459 8450 * @param pvUser The user argument, pointer to the Console instance. 8460 8451 * @param fFlags The action flags. See VMSETRTERR_FLAGS_*. … … 8465 8456 */ 8466 8457 /* static */ DECLCALLBACK(void) 8467 Console::setVMRuntimeErrorCallback(P VM pVM, void *pvUser, uint32_t fFlags,8458 Console::setVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFlags, 8468 8459 const char *pszErrorId, 8469 8460 const char *pszFormat, va_list va) … … 8478 8469 8479 8470 LogRel(("Console: VM runtime error: fatal=%RTbool, errorID=%s message=\"%s\"\n", 8480 fFatal, pszErrorId, message.c_str())); 8481 8482 that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId).raw(), 8483 Bstr(message).raw()); 8484 8485 LogFlowFuncLeave(); 8471 fFatal, pszErrorId, message.c_str())); 8472 8473 that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId).raw(), Bstr(message).raw()); 8474 8475 LogFlowFuncLeave(); NOREF(pUVM); 8486 8476 } 8487 8477 … … 9152 9142 9153 9143 Assert(pConsole->mpUVM == NULL); 9154 vmstateChangeCallback(NULL, VMSTATE_TERMINATED, VMSTATE_CREATING, 9155 pConsole); 9144 vmstateChangeCallback(NULL, VMSTATE_TERMINATED, VMSTATE_CREATING, pConsole); 9156 9145 } 9157 9146 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r44387 r44393 161 161 for (int i = 0; i < 2; i++) 162 162 { 163 inputStruct.key = (uint32_t)( (i == 0)? 'OSK0' : 'OSK1');163 inputStruct.key = (uint32_t)(i == 0 ? 'OSK0' : 'OSK1'); 164 164 kr = IOConnectCallStructMethod((mach_port_t)port, 165 165 (uint32_t)2, -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r44347 r44393 585 585 * @copydoc PFNVMPROGRESS 586 586 */ 587 static DECLCALLBACK(int) teleporterProgressCallback(P VM pVM, unsigned uPercent, void *pvUser)587 static DECLCALLBACK(int) teleporterProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser) 588 588 { 589 589 TeleporterState *pState = (TeleporterState *)pvUser; … … 604 604 } 605 605 606 NOREF(pUVM); 606 607 return VINF_SUCCESS; 607 608 }
Note:
See TracChangeset
for help on using the changeset viewer.