Changeset 106062 in vbox
- Timestamp:
- Sep 16, 2024 3:48:55 PM (4 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/UnattendedImpl.h
r106061 r106062 166 166 RTCList<WIMImage> mDetectedImages; 167 167 bool mfAvoidUpdatesOverNetwork; 168 com::SafeIfaceArray<IGuestOSType> mSupportedGuestOSTypes; 169 bool mfDoneSupportedGuestOSList; 168 170 /** @} */ 169 171 … … 331 333 bool i_updateDetectedAttributeForImage(WIMImage const &rImage); 332 334 335 /** 336 * Gets the list of guest OS type IDs supported by the current host. 337 */ 338 HRESULT i_getListOfSupportedGuestOS(); 339 333 340 }; 334 341 -
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r106061 r106062 258 258 : mhThreadReconfigureVM(NIL_RTNATIVETHREAD), mfRtcUseUtc(false), mfGuestOs64Bit(false) 259 259 , mpInstaller(NULL), mpTimeZoneInfo(NULL), mfIsDefaultAuxiliaryBasePath(true), mfDoneDetectIsoOS(false) 260 , mfAvoidUpdatesOverNetwork(false) 260 , mfAvoidUpdatesOverNetwork(false), mfDoneSupportedGuestOSList(false) 261 261 { } 262 262 … … 342 342 HRESULT hrc; 343 343 344 /* Get a list of guest OS Type Ids supported by the host. */ 345 ComPtr<ISystemProperties> pSystemProperties; 346 com::SafeIfaceArray<IGuestOSType> supportedGuestOSTypes; 347 348 hrc = mParent->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 349 if (SUCCEEDED(hrc)) 350 { 351 ComPtr<IPlatformProperties> pPlatformProperties; 352 hrc = pSystemProperties->COMGETTER(Platform)(pPlatformProperties.asOutParam()); 353 if (SUCCEEDED(hrc)) 354 { 355 hrc = pPlatformProperties->COMGETTER(SupportedGuestOSTypes)(ComSafeArrayAsOutParam(supportedGuestOSTypes)); 356 if (!SUCCEEDED(hrc)) 357 supportedGuestOSTypes.resize(0); 358 } 359 } 344 /* Populate list of supported guest OSs in case it has not been done yet. Do this before locking. */ 345 if (!mfDoneSupportedGuestOSList) 346 i_getListOfSupportedGuestOS(); 360 347 361 348 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 510 497 /* Check if detected OS type is supported (covers platform architecture). */ 511 498 bool fSupported = false; 512 for (size_t i = 0; i < supportedGuestOSTypes.size() && !fSupported; ++i)513 { 514 ComPtr<IGuestOSType> guestOSType = supportedGuestOSTypes[i];499 for (size_t i = 0; i < mSupportedGuestOSTypes.size() && !fSupported; ++i) 500 { 501 ComPtr<IGuestOSType> guestOSType = mSupportedGuestOSTypes[i]; 515 502 516 503 Bstr guestId; … … 2620 2607 return hrc; 2621 2608 2609 /* Populate list of supported guest OSs in case it has not been done yet. Do this before locking. */ 2610 if (!mfDoneSupportedGuestOSList) 2611 i_getListOfSupportedGuestOS(); 2612 2622 2613 /* 2623 2614 * Write lock this object and set attributes we got from IMachine. … … 4497 4488 return fRet; 4498 4489 } 4490 4491 HRESULT Unattended::i_getListOfSupportedGuestOS() 4492 { 4493 HRESULT hrc; 4494 if (mfDoneSupportedGuestOSList) 4495 return S_OK; 4496 mfDoneSupportedGuestOSList = true; 4497 4498 /* Get a list of guest OS Type Ids supported by the host. */ 4499 ComPtr<ISystemProperties> pSystemProperties; 4500 4501 hrc = mParent->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 4502 if (SUCCEEDED(hrc)) 4503 { 4504 ComPtr<IPlatformProperties> pPlatformProperties; 4505 hrc = pSystemProperties->COMGETTER(Platform)(pPlatformProperties.asOutParam()); 4506 if (SUCCEEDED(hrc)) 4507 { 4508 hrc = pPlatformProperties->COMGETTER(SupportedGuestOSTypes)(ComSafeArrayAsOutParam(mSupportedGuestOSTypes)); 4509 if (!SUCCEEDED(hrc)) 4510 mSupportedGuestOSTypes.resize(0); 4511 } 4512 } 4513 return hrc; 4514 }
Note:
See TracChangeset
for help on using the changeset viewer.