Changeset 53560 in vbox
- Timestamp:
- Dec 17, 2014 12:03:00 PM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r53528 r53560 694 694 MachineState_T aMachineState, 695 695 HRESULT *phrc); 696 int i_configMediumProperties(PCFGMNODE pCur, IMedium *pMedium, bool *pfHostIP); 696 697 static DECLCALLBACK(int) i_reconfigureMediumAttachment(Console *pThis, 697 698 PUVM pUVM, -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r53528 r53560 4681 4681 m_mapSecretKeys.insert(std::make_pair(Utf8Str(pszUuid), pKey)); 4682 4682 hrc = i_configureEncryptionForDisk(pszUuid); 4683 if (FAILED(hrc)) 4684 { 4685 /* Delete the key from the map. */ 4686 m_mapSecretKeys.erase(Utf8Str(pszUuid)); 4687 } 4683 4688 } 4684 4689 else -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r53523 r53560 4233 4233 /* Pass all custom parameters. */ 4234 4234 bool fHostIP = true; 4235 SafeArray<BSTR> names; 4236 SafeArray<BSTR> values; 4237 hrc = pMedium->GetProperties(Bstr().raw(), 4238 ComSafeArrayAsOutParam(names), 4239 ComSafeArrayAsOutParam(values)); H(); 4240 4241 if (names.size() != 0) 4242 { 4243 PCFGMNODE pVDC; 4244 InsertConfigNode(pCfg, "VDConfig", &pVDC); 4245 for (size_t ii = 0; ii < names.size(); ++ii) 4246 { 4247 if (values[ii] && *values[ii]) 4248 { 4249 /* Put properties of filters in a separate config node. */ 4250 Utf8Str name = names[ii]; 4251 Utf8Str value = values[ii]; 4252 size_t offSlash = name.find("/", 0); 4253 if ( offSlash != name.npos 4254 && !name.startsWith("Special/")) 4255 { 4256 com::Utf8Str strFilter; 4257 com::Utf8Str strKey; 4258 4259 hrc = strFilter.assignEx(name, 0, offSlash); H(); 4260 hrc = strKey.assignEx(name, offSlash + 1, name.length() - offSlash - 1); /* Skip slash */ H(); 4261 4262 PCFGMNODE pCfgFilterConfig = CFGMR3GetChild(pVDC, strFilter.c_str()); 4263 if (!pCfgFilterConfig) 4264 InsertConfigNode(pVDC, strFilter.c_str(), &pCfgFilterConfig); 4265 4266 InsertConfigString(pCfgFilterConfig, strKey.c_str(), value); 4267 } 4268 else 4269 { 4270 InsertConfigString(pVDC, name.c_str(), value); 4271 if ( name.compare("HostIPStack") == 0 4272 && value.compare("0") == 0) 4273 fHostIP = false; 4274 } 4275 } 4276 } 4277 } 4235 hrc = i_configMediumProperties(pCfg, pMedium, &fHostIP); H(); 4278 4236 4279 4237 /* Create an inverted list of parents. */ … … 4302 4260 } 4303 4261 4304 /* Pass all custom parameters. */ 4305 SafeArray<BSTR> aNames; 4306 SafeArray<BSTR> aValues; 4307 hrc = pMedium->GetProperties(NULL, 4308 ComSafeArrayAsOutParam(aNames), 4309 ComSafeArrayAsOutParam(aValues)); H(); 4310 4311 if (aNames.size() != 0) 4312 { 4313 PCFGMNODE pVDC; 4314 InsertConfigNode(pCur, "VDConfig", &pVDC); 4315 for (size_t ii = 0; ii < aNames.size(); ++ii) 4316 { 4317 if (aValues[ii] && *aValues[ii]) 4318 { 4319 Utf8Str name = aNames[ii]; 4320 Utf8Str value = aValues[ii]; 4321 InsertConfigString(pVDC, name.c_str(), value); 4322 if ( name.compare("HostIPStack") == 0 4323 && value.compare("0") == 0) 4324 fHostIP = false; 4325 } 4326 } 4327 } 4262 /* Configure medium properties. */ 4263 hrc = i_configMediumProperties(pCur, pMedium, &fHostIP); H(); 4328 4264 4329 4265 /* next */ … … 4347 4283 4348 4284 return VINF_SUCCESS; 4285 } 4286 4287 /** 4288 * Adds the medium properties to the CFGM tree. 4289 * 4290 * @returns VBox status code. 4291 * @param pCur The current CFGM node. 4292 * @param pMedium The medium object to configure. 4293 * @param pfHostIP Where to return the value of the \"HostIPStack\" property if found. 4294 */ 4295 int Console::i_configMediumProperties(PCFGMNODE pCur, IMedium *pMedium, bool *pfHostIP) 4296 { 4297 /* Pass all custom parameters. */ 4298 SafeArray<BSTR> aNames; 4299 SafeArray<BSTR> aValues; 4300 HRESULT hrc = pMedium->GetProperties(NULL, ComSafeArrayAsOutParam(aNames), 4301 ComSafeArrayAsOutParam(aValues)); 4302 4303 if ( SUCCEEDED(hrc) 4304 && aNames.size() != 0) 4305 { 4306 PCFGMNODE pVDC; 4307 InsertConfigNode(pCur, "VDConfig", &pVDC); 4308 for (size_t ii = 0; ii < aNames.size(); ++ii) 4309 { 4310 if (aValues[ii] && *aValues[ii]) 4311 { 4312 Utf8Str name = aNames[ii]; 4313 Utf8Str value = aValues[ii]; 4314 size_t offSlash = name.find("/", 0); 4315 if ( offSlash != name.npos 4316 && !name.startsWith("Special/")) 4317 { 4318 com::Utf8Str strFilter; 4319 com::Utf8Str strKey; 4320 4321 hrc = strFilter.assignEx(name, 0, offSlash); 4322 if (FAILED(hrc)) 4323 break; 4324 4325 hrc = strKey.assignEx(name, offSlash + 1, name.length() - offSlash - 1); /* Skip slash */ 4326 if (FAILED(hrc)) 4327 break; 4328 4329 PCFGMNODE pCfgFilterConfig = CFGMR3GetChild(pVDC, strFilter.c_str()); 4330 if (!pCfgFilterConfig) 4331 InsertConfigNode(pVDC, strFilter.c_str(), &pCfgFilterConfig); 4332 4333 InsertConfigString(pCfgFilterConfig, strKey.c_str(), value); 4334 } 4335 else 4336 { 4337 InsertConfigString(pVDC, name.c_str(), value); 4338 if ( name.compare("HostIPStack") == 0 4339 && value.compare("0") == 0) 4340 *pfHostIP = false; 4341 } 4342 } 4343 } 4344 } 4345 4346 return hrc; 4349 4347 } 4350 4348
Note:
See TracChangeset
for help on using the changeset viewer.