Changeset 31753 in vbox
- Timestamp:
- Aug 18, 2010 11:30:02 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/ftm.h
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
r31743 r31753 44 44 VMMR3DECL(int) FTMR3Init(PVM pVM); 45 45 VMMR3DECL(int) FTMR3Term(PVM pVM); 46 VMMR3DECL(int) FTMR3StandbyCancel(PVM pVM); 46 47 47 48 #endif /* IN_RING3 */ -
Property svn:eol-style
set to
-
trunk/src/VBox/VMM/FTM.cpp
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
r31743 r31753 44 44 { 45 45 /** @todo saved state for master nodes! */ 46 pVM->ftm.s.pszAddress = NULL; 47 pVM->ftm.s.pszPassword = NULL; 48 pVM->fFaultTolerantMaster = false; 46 pVM->ftm.s.pszAddress = NULL; 47 pVM->ftm.s.pszPassword = NULL; 48 pVM->fFaultTolerantMaster = false; 49 pVM->ftm.s.fIsStandbyNode = false; 50 pVM->ftm.s.standby.hServer = NULL; 49 51 return VINF_SUCCESS; 50 52 } … … 65 67 if (pVM->ftm.s.pszPassword) 66 68 RTMemFree(pVM->ftm.s.pszPassword); 69 if (pVM->ftm.s.standby.hServer) 70 RTTcpServerDestroy(pVM->ftm.s.standby.hServer); 67 71 68 72 return VINF_SUCCESS; … … 111 115 * @param fMaster FT master or standby 112 116 * @param uInterval FT sync interval 113 * @param pszAddress MasterVM address114 * @param uPort MasterVM port115 * @param pszPassword FT password 117 * @param pszAddress Standby VM address 118 * @param uPort Standby VM port 119 * @param pszPassword FT password (NULL for none) 116 120 * 117 121 * @thread Any thread. … … 121 125 VMMR3DECL(int) FTMR3PowerOn(PVM pVM, bool fMaster, unsigned uInterval, const char *pszAddress, unsigned uPort, const char *pszPassword) 122 126 { 123 int rc ;127 int rc = VINF_SUCCESS; 124 128 125 129 VMSTATE enmVMState = VMR3GetState(pVM); … … 147 151 { 148 152 /* standby */ 149 PRTTCPSERVER hServer; 150 151 rc = RTTcpServerCreateEx(pszAddress, uPort, &hServer); 153 rc = RTTcpServerCreateEx(pszAddress, uPort, &pVM->ftm.s.standby.hServer); 152 154 if (RT_FAILURE(rc)) 153 155 return rc; 156 pVM->ftm.s.fIsStandbyNode = true; 154 157 155 rc = RTTcpServerListen( hServer, ftmR3StandbyServeConnection, pVM);158 rc = RTTcpServerListen(pVM->ftm.s.standby.hServer, ftmR3StandbyServeConnection, pVM); 156 159 /** @todo deal with the exit code to check if we should activate this standby VM. */ 157 160 158 RTTcpServerDestroy(hServer); 161 RTTcpServerDestroy(pVM->ftm.s.standby.hServer); 162 pVM->ftm.s.standby.hServer = NULL; 159 163 } 160 return VERR_NOT_IMPLEMENTED;164 return rc; 161 165 } 162 166 167 /** 168 * Powers off the fault tolerant virtual machine (standby). 169 * 170 * @returns VBox status code. 171 * 172 * @param pVM The VM to power on. 173 */ 174 VMMR3DECL(int) FTMR3StandbyCancel(PVM pVM) 175 { 176 AssertReturn(!pVM->fFaultTolerantMaster, VERR_NOT_SUPPORTED); 177 Assert(pVM->ftm.s.standby.hServer); 178 179 return RTTcpServerShutdown(pVM->ftm.s.standby.hServer); 180 } -
Property svn:eol-style
set to
-
trunk/src/VBox/VMM/FTMInternal.h
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
r31743 r31753 22 22 #include <VBox/types.h> 23 23 #include <VBox/ftm.h> 24 #include <iprt/tcp.h> 24 25 25 26 … … 36 37 typedef struct FTM 37 38 { 38 char *pszAddress; 39 char *pszPassword; 40 unsigned uPort; 41 unsigned uInterval; 39 /** Address of the standby VM. */ 40 char *pszAddress; 41 /** Port of the standby VM. */ 42 unsigned uPort; 43 /** Password to access the syncing server of the standby VM. */ 44 char *pszPassword; 45 /** Syncing interval in ms. */ 46 unsigned uInterval; 47 48 /** Set when this VM is the standby FT node. */ 49 bool fIsStandbyNode; 50 51 struct 52 { 53 PRTTCPSERVER hServer; 54 } standby; 42 55 43 56 } FTM; -
Property svn:eol-style
set to
Note:
See TracChangeset
for help on using the changeset viewer.