Changeset 31737 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 17, 2010 2:51:12 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 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 } -
trunk/src/VBox/VMM/VM.cpp
r31695 r31737 62 62 #include <VBox/iom.h> 63 63 #include <VBox/ssm.h> 64 #include <VBox/ftm.h> 64 65 #include <VBox/hwaccm.h> 65 66 #include "VMInternal.h" … … 836 837 if (RT_SUCCESS(rc)) 837 838 { 838 rc = VMMR3Init(pVM);839 rc = FTMR3Init(pVM); 839 840 if (RT_SUCCESS(rc)) 840 841 { 841 rc = SELMR3Init(pVM);842 rc = VMMR3Init(pVM); 842 843 if (RT_SUCCESS(rc)) 843 844 { 844 rc = TRPMR3Init(pVM);845 rc = SELMR3Init(pVM); 845 846 if (RT_SUCCESS(rc)) 846 847 { 847 rc = CSAMR3Init(pVM);848 rc = TRPMR3Init(pVM); 848 849 if (RT_SUCCESS(rc)) 849 850 { 850 rc = PATMR3Init(pVM);851 rc = CSAMR3Init(pVM); 851 852 if (RT_SUCCESS(rc)) 852 853 { 853 rc = IOMR3Init(pVM);854 rc = PATMR3Init(pVM); 854 855 if (RT_SUCCESS(rc)) 855 856 { 856 rc = EMR3Init(pVM);857 rc = IOMR3Init(pVM); 857 858 if (RT_SUCCESS(rc)) 858 859 { 859 rc = DBGFR3Init(pVM);860 rc = EMR3Init(pVM); 860 861 if (RT_SUCCESS(rc)) 861 862 { 862 rc = PDMR3Init(pVM);863 rc = DBGFR3Init(pVM); 863 864 if (RT_SUCCESS(rc)) 864 865 { 865 rc = PGMR3InitDynMap(pVM); 866 if (RT_SUCCESS(rc)) 867 rc = MMR3HyperInitFinalize(pVM); 868 if (RT_SUCCESS(rc)) 869 rc = PATMR3InitFinalize(pVM); 870 if (RT_SUCCESS(rc)) 871 rc = PGMR3InitFinalize(pVM); 872 if (RT_SUCCESS(rc)) 873 rc = SELMR3InitFinalize(pVM); 874 if (RT_SUCCESS(rc)) 875 rc = TMR3InitFinalize(pVM); 876 if (RT_SUCCESS(rc)) 877 rc = VMMR3InitFinalize(pVM); 878 if (RT_SUCCESS(rc)) 879 rc = REMR3InitFinalize(pVM); 880 if (RT_SUCCESS(rc)) 881 rc = vmR3InitDoCompleted(pVM, VMINITCOMPLETED_RING3); 866 rc = PDMR3Init(pVM); 882 867 if (RT_SUCCESS(rc)) 883 868 { 884 LogFlow(("vmR3InitRing3: returns %Rrc\n", VINF_SUCCESS)); 885 return VINF_SUCCESS; 869 rc = PGMR3InitDynMap(pVM); 870 if (RT_SUCCESS(rc)) 871 rc = MMR3HyperInitFinalize(pVM); 872 if (RT_SUCCESS(rc)) 873 rc = PATMR3InitFinalize(pVM); 874 if (RT_SUCCESS(rc)) 875 rc = PGMR3InitFinalize(pVM); 876 if (RT_SUCCESS(rc)) 877 rc = SELMR3InitFinalize(pVM); 878 if (RT_SUCCESS(rc)) 879 rc = TMR3InitFinalize(pVM); 880 if (RT_SUCCESS(rc)) 881 rc = VMMR3InitFinalize(pVM); 882 if (RT_SUCCESS(rc)) 883 rc = REMR3InitFinalize(pVM); 884 if (RT_SUCCESS(rc)) 885 rc = vmR3InitDoCompleted(pVM, VMINITCOMPLETED_RING3); 886 if (RT_SUCCESS(rc)) 887 { 888 LogFlow(("vmR3InitRing3: returns %Rrc\n", VINF_SUCCESS)); 889 return VINF_SUCCESS; 890 } 891 int rc2 = PDMR3Term(pVM); 892 AssertRC(rc2); 886 893 } 887 int rc2 = PDMR3Term(pVM);894 int rc2 = DBGFR3Term(pVM); 888 895 AssertRC(rc2); 889 896 } 890 int rc2 = DBGFR3Term(pVM);897 int rc2 = EMR3Term(pVM); 891 898 AssertRC(rc2); 892 899 } 893 int rc2 = EMR3Term(pVM);900 int rc2 = IOMR3Term(pVM); 894 901 AssertRC(rc2); 895 902 } 896 int rc2 = IOMR3Term(pVM);903 int rc2 = PATMR3Term(pVM); 897 904 AssertRC(rc2); 898 905 } 899 int rc2 = PATMR3Term(pVM);906 int rc2 = CSAMR3Term(pVM); 900 907 AssertRC(rc2); 901 908 } 902 int rc2 = CSAMR3Term(pVM);909 int rc2 = TRPMR3Term(pVM); 903 910 AssertRC(rc2); 904 911 } 905 int rc2 = TRPMR3Term(pVM);912 int rc2 = SELMR3Term(pVM); 906 913 AssertRC(rc2); 907 914 } 908 int rc2 = SELMR3Term(pVM);915 int rc2 = VMMR3Term(pVM); 909 916 AssertRC(rc2); 910 917 } 911 int rc2 = VMMR3Term(pVM);918 int rc2 = FTMR3Term(pVM); 912 919 AssertRC(rc2); 913 920 } … … 2244 2251 #endif 2245 2252 AssertRC(rc); 2253 rc = FTMR3Term(pVM); 2254 AssertRC(rc); 2246 2255 rc = DBGFR3Term(pVM); 2247 2256 AssertRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.