- Timestamp:
- Dec 18, 2012 3:38:58 PM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r43908 r44151 524 524 int configConstructorInner(PVM pVM, AutoWriteLock *pAlock); 525 525 int configCfgmOverlay(PVM pVM, IVirtualBox *pVirtualBox, IMachine *pMachine); 526 int configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine); 526 527 527 528 int configMediumAttachment(PCFGMNODE pCtlInst, -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r44103 r44151 2820 2820 rc = configCfgmOverlay(pVM, virtualBox, pMachine); 2821 2821 2822 /* 2823 * Dump all extradata API settings tweaks, both global and per VM. 2824 */ 2825 if (RT_SUCCESS(rc)) 2826 rc = configDumpAPISettingsTweaks(virtualBox, pMachine); 2827 2822 2828 #undef H 2823 2829 … … 2849 2855 2850 2856 /** 2851 * Applies the CFGM overlay as specified by /VBoxInternal/XXX extra data2857 * Applies the CFGM overlay as specified by VBoxInternal/XXX extra data 2852 2858 * values. 2853 2859 * … … 2890 2896 2891 2897 hrc = pMachine->GetExtraDataKeys(ComSafeArrayAsOutParam(aMachineExtraDataKeys)); 2892 AssertMsg(SUCCEEDED(hrc), (" VirtualBox::GetExtraDataKeys failed with %Rhrc\n", hrc));2898 AssertMsg(SUCCEEDED(hrc), ("Machine::GetExtraDataKeys failed with %Rhrc\n", hrc)); 2893 2899 2894 2900 // build a combined list from global keys... … … 3003 3009 } 3004 3010 return rc; 3011 } 3012 3013 /** 3014 * Dumps the API settings tweaks as specified by VBoxInternal2/XXX extra data 3015 * values. 3016 * 3017 * @returns VBox status code. 3018 * @param pVirtualBox Pointer to the IVirtualBox interface. 3019 * @param pMachine Pointer to the IMachine interface. 3020 */ 3021 /* static */ 3022 int Console::configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine) 3023 { 3024 { 3025 SafeArray<BSTR> aGlobalExtraDataKeys; 3026 HRESULT hrc = pVirtualBox->GetExtraDataKeys(ComSafeArrayAsOutParam(aGlobalExtraDataKeys)); 3027 AssertMsg(SUCCEEDED(hrc), ("VirtualBox::GetExtraDataKeys failed with %Rhrc\n", hrc)); 3028 bool hasKey = false; 3029 for (size_t i = 0; i < aGlobalExtraDataKeys.size(); i++) 3030 { 3031 Utf8Str strKey(aGlobalExtraDataKeys[i]); 3032 if (!strKey.startsWith("VBoxInternal2/")) 3033 continue; 3034 3035 Bstr bstrValue; 3036 hrc = pVirtualBox->GetExtraData(Bstr(strKey).raw(), 3037 bstrValue.asOutParam()); 3038 if (FAILED(hrc)) 3039 continue; 3040 if (!hasKey) 3041 LogRel(("Global extradata API settings:\n")); 3042 LogRel((" %s=\"%ls\"\n", strKey.c_str(), bstrValue.raw())); 3043 hasKey = true; 3044 } 3045 } 3046 3047 { 3048 SafeArray<BSTR> aMachineExtraDataKeys; 3049 HRESULT hrc = pMachine->GetExtraDataKeys(ComSafeArrayAsOutParam(aMachineExtraDataKeys)); 3050 AssertMsg(SUCCEEDED(hrc), ("Machine::GetExtraDataKeys failed with %Rhrc\n", hrc)); 3051 bool hasKey = false; 3052 for (size_t i = 0; i < aMachineExtraDataKeys.size(); i++) 3053 { 3054 Utf8Str strKey(aMachineExtraDataKeys[i]); 3055 if (!strKey.startsWith("VBoxInternal2/")) 3056 continue; 3057 3058 Bstr bstrValue; 3059 hrc = pMachine->GetExtraData(Bstr(strKey).raw(), 3060 bstrValue.asOutParam()); 3061 if (FAILED(hrc)) 3062 continue; 3063 if (!hasKey) 3064 LogRel(("Per-VM extradata API settings:\n")); 3065 LogRel((" %s=\"%ls\"\n", strKey.c_str(), bstrValue.raw())); 3066 hasKey = true; 3067 } 3068 } 3069 3070 return VINF_SUCCESS; 3005 3071 } 3006 3072
Note:
See TracChangeset
for help on using the changeset viewer.