Changeset 101318 in vbox
- Timestamp:
- Sep 29, 2023 3:13:07 PM (18 months ago)
- svn:sync-xref-src-repo-rev:
- 159318
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r101302 r101318 2704 2704 <interface 2705 2705 name="IVirtualBox" extends="$unknown" 2706 uuid=" 901ac662-0b6e-4b19-a0ac-21cb54d4d5b2"2706 uuid="d644ad1e-c501-4fc7-9ab6-aa6d763bc540" 2707 2707 wsmap="managed" 2708 2708 rest="managed" … … 3893 3893 downloaded from. 3894 3894 </desc> 3895 <param name="platformArchitecture" type="PlatformArchitecture" dir="in"> 3896 <desc> 3897 Architecture of firmware to check. 3898 </desc> 3899 </param> 3895 3900 <param name="firmwareType" type="FirmwareType" dir="in"> 3896 3901 <desc> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r101035 r101318 1256 1256 DECL_HIDDEN_THROW(Utf8Str *) GetExtraDataBoth(IVirtualBox *pVirtualBox, IMachine *pMachine, const char *pszName, Utf8Str *pStrValue); 1257 1257 1258 #ifndef VBOX_WITH_EFI_IN_DD2 1259 DECLHIDDEN(int) findEfiRom(IVirtualBox* vbox, PlatformArchitecture_T aPlatformArchitecture, FirmwareType_T aFirmwareType, Utf8Str *pEfiRomFile); 1260 #endif 1261 1258 1262 #endif /* !MAIN_INCLUDED_ConsoleImpl_h */ 1259 1263 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r101299 r101318 438 438 ComPtr<ICloudNetwork> &aNetwork); 439 439 HRESULT removeCloudNetwork(const ComPtr<ICloudNetwork> &aNetwork); 440 HRESULT checkFirmwarePresent(FirmwareType_T aFirmwareType, 440 HRESULT checkFirmwarePresent(PlatformArchitecture_T aPlatformArchitecture, 441 FirmwareType_T aFirmwareType, 441 442 const com::Utf8Str &aVersion, 442 443 com::Utf8Str &aUrl, -
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r101173 r101318 3421 3421 } 3422 3422 3423 3424 #ifndef VBOX_WITH_EFI_IN_DD2 3425 DECLHIDDEN(int) findEfiRom(IVirtualBox* vbox, PlatformArchitecture_T aPlatformArchitecture, FirmwareType_T aFirmwareType, Utf8Str *pEfiRomFile) 3426 { 3427 Bstr aFilePath, empty; 3428 BOOL fPresent = FALSE; 3429 HRESULT hrc = vbox->CheckFirmwarePresent(aPlatformArchitecture, aFirmwareType, empty.raw(), 3430 empty.asOutParam(), aFilePath.asOutParam(), &fPresent); 3431 AssertComRCReturn(hrc, Global::vboxStatusCodeFromCOM(hrc)); 3432 3433 if (!fPresent) 3434 { 3435 LogRel(("Failed to find an EFI ROM file.\n")); 3436 return VERR_FILE_NOT_FOUND; 3437 } 3438 3439 *pEfiRomFile = Utf8Str(aFilePath); 3440 3441 return VINF_SUCCESS; 3442 } 3443 #endif -
trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp
r101271 r101318 194 194 } 195 195 }; 196 197 #ifndef VBOX_WITH_EFI_IN_DD2198 static int findEfiRom(IVirtualBox* vbox, FirmwareType_T aFirmwareType, Utf8Str *pEfiRomFile)199 {200 Bstr aFilePath, empty;201 BOOL fPresent = FALSE;202 HRESULT hrc = vbox->CheckFirmwarePresent(aFirmwareType, empty.raw(),203 empty.asOutParam(), aFilePath.asOutParam(), &fPresent);204 AssertComRCReturn(hrc, Global::vboxStatusCodeFromCOM(hrc));205 206 if (!fPresent)207 {208 LogRel(("Failed to find an EFI ROM file.\n"));209 return VERR_FILE_NOT_FOUND;210 }211 212 *pEfiRomFile = Utf8Str(aFilePath);213 214 return VINF_SUCCESS;215 }216 #endif217 196 218 197 /** … … 1676 1655 #else 1677 1656 Utf8Str efiRomFile; 1678 vrc = findEfiRom(virtualBox, eFwType, &efiRomFile);1657 vrc = findEfiRom(virtualBox, PlatformArchitecture_x86, eFwType, &efiRomFile); 1679 1658 AssertRCReturn(vrc, vrc); 1680 1659 const char *pszEfiRomFile = efiRomFile.c_str(); -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r101299 r101318 470 470 }; 471 471 472 473 /** 474 * VirtualBox firmware descriptor. 475 */ 476 typedef struct VBOXFWDESC 477 { 478 FirmwareType_T enmType; 479 bool fBuiltIn; 480 const char *pszFileName; 481 const char *pszUrl; 482 } VBoxFwDesc; 483 typedef const VBOXFWDESC *PVBOXFWDESC; 484 485 472 486 // constructor / destructor 473 487 ///////////////////////////////////////////////////////////////////////////// … … 1885 1899 } 1886 1900 1887 HRESULT VirtualBox::checkFirmwarePresent(FirmwareType_T aFirmwareType, 1901 HRESULT VirtualBox::checkFirmwarePresent(PlatformArchitecture_T aPlatformArchitecture, 1902 FirmwareType_T aFirmwareType, 1888 1903 const com::Utf8Str &aVersion, 1889 1904 com::Utf8Str &aUrl, … … 1893 1908 NOREF(aVersion); 1894 1909 1895 static const struct 1896 { 1897 FirmwareType_T enmType; 1898 bool fBuiltIn; 1899 const char *pszFileName; 1900 const char *pszUrl; 1901 } 1902 firmwareDesc[] = 1910 static const VBOXFWDESC s_FwDescX86[] = 1903 1911 { 1904 1912 { FirmwareType_BIOS, true, NULL, NULL }, … … 1914 1922 }; 1915 1923 1916 for (size_t i = 0; i < sizeof(firmwareDesc) / sizeof(firmwareDesc[0]); i++) 1917 { 1918 if (aFirmwareType != firmwareDesc[i].enmType) 1924 static const VBOXFWDESC s_FwDescArm[] = 1925 { 1926 #ifdef VBOX_WITH_EFI_IN_DD2 1927 { FirmwareType_EFI32, true, "VBoxEFIAArch32.fd", NULL }, 1928 { FirmwareType_EFI64, true, "VBoxEFIAArch64.fd", NULL }, 1929 #else 1930 { FirmwareType_EFI32, false, "VBoxEFIAArch32.fd", "http://virtualbox.org/firmware/VBoxEFIAArch32.fd" }, 1931 { FirmwareType_EFI64, false, "VBoxEFIAArch64.fd", "http://virtualbox.org/firmware/VBoxEFIAArch64.fd" }, 1932 #endif 1933 }; 1934 1935 PVBOXFWDESC pFwDesc = NULL; 1936 uint32_t cFwDesc = 0; 1937 if (aPlatformArchitecture == PlatformArchitecture_x86) 1938 { 1939 pFwDesc = &s_FwDescX86[0]; 1940 cFwDesc = RT_ELEMENTS(s_FwDescX86); 1941 } 1942 else if (aPlatformArchitecture == PlatformArchitecture_ARM) 1943 { 1944 pFwDesc = &s_FwDescArm[0]; 1945 cFwDesc = RT_ELEMENTS(s_FwDescArm); 1946 } 1947 else 1948 return E_INVALIDARG; 1949 1950 for (size_t i = 0; i < cFwDesc; i++) 1951 { 1952 if (aFirmwareType != pFwDesc->enmType) 1953 { 1954 pFwDesc++; 1919 1955 continue; 1956 } 1920 1957 1921 1958 /* compiled-in firmware */ 1922 if ( firmwareDesc[i].fBuiltIn)1923 { 1924 aFile = firmwareDesc[i].pszFileName;1959 if (pFwDesc->fBuiltIn) 1960 { 1961 aFile = pFwDesc->pszFileName; 1925 1962 *aResult = TRUE; 1926 1963 break; … … 1928 1965 1929 1966 Utf8Str fullName; 1930 Utf8StrFmt shortName("Firmware%c%s", RTPATH_DELIMITER, firmwareDesc[i].pszFileName);1967 Utf8StrFmt shortName("Firmware%c%s", RTPATH_DELIMITER, pFwDesc->pszFileName); 1931 1968 int vrc = i_calculateFullPath(shortName, fullName); 1932 1969 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); … … 1941 1978 vrc = RTPathExecDir(szVBoxPath, RTPATH_MAX); 1942 1979 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); 1943 vrc = RTPathAppend(szVBoxPath, sizeof(szVBoxPath), firmwareDesc[i].pszFileName);1980 vrc = RTPathAppend(szVBoxPath, sizeof(szVBoxPath), pFwDesc->pszFileName); 1944 1981 AssertRCReturn(vrc, VBOX_E_IPRT_ERROR); 1945 1982 if (RTFileExists(szVBoxPath)) … … 1951 1988 1952 1989 /** @todo account for version in the URL */ 1953 aUrl = firmwareDesc[i].pszUrl;1990 aUrl = pFwDesc->pszUrl; 1954 1991 *aResult = FALSE; 1955 1992
Note:
See TracChangeset
for help on using the changeset viewer.