Changeset 105254 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Jul 10, 2024 9:39:16 AM (9 months ago)
- svn:sync-xref-src-repo-rev:
- 163901
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r103598 r105254 2134 2134 2135 2135 2136 static HRESULT listExecutionEnginesForCpuArchitecture(CPUArchitecture_T enmCpuArchitecture, const ComPtr<ISystemProperties> ptrSysProps, const ComPtr<IHost> pHost, 2137 HRESULT hrc) 2138 { 2139 const char *pszArchitecture = "???"; 2140 switch (enmCpuArchitecture) 2141 { 2142 case CPUArchitecture_x86: pszArchitecture = "x86"; break; 2143 case CPUArchitecture_AMD64: pszArchitecture = "AMD64"; break; 2144 case CPUArchitecture_ARMv8_32: pszArchitecture = "ARMv8 (32-bit only)"; break; 2145 case CPUArchitecture_ARMv8_64: pszArchitecture = "ARMv8 (64-bit)"; break; 2146 #ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK 2147 case CPUArchitecture_32BitHack: 2148 #endif 2149 case CPUArchitecture_Any: 2150 break; 2151 } 2152 2153 /* Query all possible execution engines supported by the build. */ 2154 com::SafeArray<VMExecutionEngine_T> aExecutionEngines; 2155 CHECK_ERROR2I_RET(ptrSysProps, GetExecutionEnginesForVmCpuArchitecture(enmCpuArchitecture, 2156 ComSafeArrayAsOutParam(aExecutionEngines)), hrcCheck); 2157 2158 /* Don't dump anything if the architecture is not supported at all. */ 2159 if (aExecutionEngines.size()) 2160 { 2161 /* Now filter out the ones the host actually supports. */ 2162 std::vector<VMExecutionEngine_T> vecExecEnginesSupported; 2163 for (size_t i = 0; i < aExecutionEngines.size(); i++) 2164 { 2165 BOOL fSupported = FALSE; 2166 CHECK_ERROR2I_RET(pHost, IsExecutionEngineSupported(enmCpuArchitecture, aExecutionEngines[i], &fSupported), hrcCheck); 2167 if (fSupported) 2168 vecExecEnginesSupported.push_back(aExecutionEngines[i]); 2169 } 2170 2171 RTPrintf(List::tr("CPU Architecture: %s\n"), pszArchitecture); 2172 2173 /* Print what we've got. */ 2174 for (size_t i = 0; i < vecExecEnginesSupported.size(); i++) 2175 { 2176 const char *pszExecEngine = "???"; 2177 switch (vecExecEnginesSupported[i]) 2178 { 2179 case VMExecutionEngine_Default: pszExecEngine = "Default"; break; 2180 case VMExecutionEngine_HwVirt: pszExecEngine = "HwVirt"; break; 2181 case VMExecutionEngine_NativeApi: pszExecEngine = "NativeApi"; break; 2182 case VMExecutionEngine_Interpreter: pszExecEngine = "Interpreter"; break; 2183 case VMExecutionEngine_Recompiler: pszExecEngine = "Recompiler"; break; 2184 default: break; 2185 } 2186 2187 RTPrintf(" #%02zu: %s\n", i, pszExecEngine); 2188 } 2189 } 2190 2191 return hrc; 2192 } 2193 2194 2195 /** 2196 * List all execution engines supported by the host. 2197 * 2198 * @returns See produceList. 2199 * @param ptrVirtualBox Reference to the smart IVirtualBox pointer. 2200 */ 2201 static HRESULT listExecutionEngines(const ComPtr<IVirtualBox> &ptrVirtualBox) 2202 { 2203 ComPtr<ISystemProperties> ptrSysProps; 2204 CHECK_ERROR2I_RET(ptrVirtualBox, COMGETTER(SystemProperties)(ptrSysProps.asOutParam()), hrcCheck); 2205 ComPtr<IHost> pHost; 2206 CHECK_ERROR2I_RET(ptrVirtualBox, COMGETTER(Host)(pHost.asOutParam()), hrcCheck); 2207 2208 HRESULT hrc = listExecutionEnginesForCpuArchitecture(CPUArchitecture_x86, ptrSysProps, pHost, S_OK); 2209 hrc = listExecutionEnginesForCpuArchitecture(CPUArchitecture_AMD64, ptrSysProps, pHost, hrc); 2210 hrc = listExecutionEnginesForCpuArchitecture(CPUArchitecture_ARMv8_32, ptrSysProps, pHost, hrc); 2211 hrc = listExecutionEnginesForCpuArchitecture(CPUArchitecture_ARMv8_64, ptrSysProps, pHost, hrc); 2212 2213 return hrc; 2214 } 2215 2216 2136 2217 /** 2137 2218 * The type of lists we can produce. … … 2178 2259 kListCloudProfiles, 2179 2260 kListCPUProfiles, 2180 kListHostDrives 2261 kListHostDrives, 2262 kListExecutionEngines 2181 2263 }; 2182 2264 … … 2533 2615 hrc = listHostDrives(pVirtualBox, fOptLong); 2534 2616 break; 2617 2618 case kListExecutionEngines: 2619 hrc = listExecutionEngines(pVirtualBox); 2620 break; 2621 2535 2622 /* No default here, want gcc warnings. */ 2536 2623 … … 2604 2691 { "cpu-profiles", kListCPUProfiles, RTGETOPT_REQ_NOTHING }, 2605 2692 { "hostdrives", kListHostDrives, RTGETOPT_REQ_NOTHING }, 2693 { "execution-engines", kListExecutionEngines, RTGETOPT_REQ_NOTHING }, 2606 2694 }; 2607 2695 … … 2675 2763 case kListCPUProfiles: 2676 2764 case kListHostDrives: 2765 case kListExecutionEngines: 2677 2766 enmOptCommand = (enum ListType_T)ch; 2678 2767 if (fOptMultiple)
Note:
See TracChangeset
for help on using the changeset viewer.