Changeset 31737 in vbox for trunk/src/VBox/VMM/FTM.cpp
- Timestamp:
- Aug 17, 2010 2:51:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/FTM.cpp
r31734 r31737 21 21 *******************************************************************************/ 22 22 #define LOG_GROUP LOG_GROUP_FTM 23 #include "FTMInternal.h" 24 #include <VBox/vm.h> 23 25 #include <VBox/vmm.h> 24 #include <VBox/vm.h>25 26 #include <VBox/err.h> 26 27 #include <VBox/param.h> 27 #include "FTMInternal.h"28 #include <VBox/ssm.h> 28 29 29 30 #include <iprt/assert.h> 31 #include <iprt/thread.h> 32 #include <iprt/string.h> 33 #include <iprt/mem.h> 30 34 #include <VBox/log.h> 31 35 36 /** 37 * Initializes the FTM. 38 * 39 * @returns VBox status code. 40 * @param pVM The VM to operate on. 41 */ 42 VMMR3DECL(int) FTMR3Init(PVM pVM) 43 { 44 /** @todo saved state for master nodes! */ 45 pVM->ftm.s.pszAddress = NULL; 46 pVM->fFaultTolerantMaster = false; 47 return VINF_SUCCESS; 48 } 49 50 /** 51 * Terminates the FTM. 52 * 53 * Termination means cleaning up and freeing all resources, 54 * the VM it self is at this point powered off or suspended. 55 * 56 * @returns VBox status code. 57 * @param pVM The VM to operate on. 58 */ 59 VMMR3DECL(int) FTMR3Term(PVM pVM) 60 { 61 if (pVM->ftm.s.pszAddress) 62 RTMemFree(pVM->ftm.s.pszAddress); 63 64 return VINF_SUCCESS; 65 } 66 67 /** 68 * Thread function which starts syncing process for this master VM 69 * 70 * @param Thread The thread id. 71 * @param pvUser Not used 72 * @return VINF_SUCCESS (ignored). 73 * 74 * @note Locks the Console object for writing. 75 */ 76 static DECLCALLBACK(int) ftmR3MasterThread(RTTHREAD Thread, void *pvUser) 77 { 78 return VINF_SUCCESS; 79 } 32 80 33 81 /** … … 48 96 VMMR3DECL(int) FTMR3PowerOn(PVM pVM, bool fMaster, unsigned uInterval, const char *pszAddress, unsigned uPort) 49 97 { 98 int rc; 99 50 100 VMSTATE enmVMState = VMR3GetState(pVM); 51 101 AssertMsgReturn(enmVMState == VMSTATE_POWERING_ON, … … 53 103 VERR_INTERNAL_ERROR_4); 54 104 105 pVM->ftm.s.uInterval = uInterval; 106 pVM->ftm.s.uPort = uPort; 107 pVM->ftm.s.pszAddress = RTStrDup(pszAddress); 55 108 if (fMaster) 56 109 { 110 rc = RTThreadCreate(NULL, ftmR3MasterThread, NULL, 111 0, RTTHREADTYPE_IO /* higher than normal priority */, 0, "ftmR3MasterThread"); 112 if (RT_FAILURE(rc)) 113 return rc; 114 115 pVM->fFaultTolerantMaster = true; 57 116 return VMR3PowerOn(pVM); 58 117 }
Note:
See TracChangeset
for help on using the changeset viewer.