- 時間撮記:
- 2015-3-13 下午05:59:58 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r54716 r54758 5000 5000 } 5001 5001 5002 void Console::i_removeSecretKeysOnSuspend() 5003 { 5004 /* Remove keys which are supposed to be removed on a suspend. */ 5005 SecretKeyMap::iterator it = m_mapSecretKeys.begin(); 5006 while (it != m_mapSecretKeys.end()) 5007 { 5008 SecretKey *pKey = it->second; 5009 if (pKey->m_fRemoveOnSuspend) 5010 { 5011 /* Unconfigure disk encryption from all attachments associated with this key. */ 5012 i_clearDiskEncryptionKeysOnAllAttachmentsWithKeyId(it->first); 5013 5014 AssertMsg(!pKey->m_cRefs, ("No one should access the stored key at this point anymore!\n")); 5015 delete pKey; 5016 m_mapSecretKeys.erase(it++); 5017 } 5018 else 5019 it++; 5020 } 5021 } 5022 5002 5023 /** 5003 5024 * Process a network adaptor change. … … 6350 6371 case MachineState_TeleportingPausedVM: 6351 6372 case MachineState_Saving: 6373 6374 /* Remove any keys which are supposed to be removed on a suspend. */ 6375 if ( aReason == Reason_HostSuspend 6376 || aReason == Reason_HostBatteryLow) 6377 i_removeSecretKeysOnSuspend(); 6378 6352 6379 return setError(VBOX_E_INVALID_VM_STATE, tr("Already paused")); 6353 6380 … … 6379 6406 if (RT_FAILURE(vrc)) 6380 6407 hrc = setError(VBOX_E_VM_ERROR, tr("Could not suspend the machine execution (%Rrc)"), vrc); 6381 else 6382 { 6383 /* Remove keys which are supposed to be removed on a VM suspend. */ 6384 SecretKeyMap::iterator it = m_mapSecretKeys.begin(); 6385 while (it != m_mapSecretKeys.end()) 6386 { 6387 SecretKey *pKey = it->second; 6388 if (pKey->m_fRemoveOnSuspend) 6389 { 6390 /* Unconfigure disk encryption from all attachments associated with this key. */ 6391 i_clearDiskEncryptionKeysOnAllAttachmentsWithKeyId(it->first); 6392 6393 AssertMsg(!pKey->m_cRefs, ("No one should access the stored key at this point anymore!\n")); 6394 delete pKey; 6395 m_mapSecretKeys.erase(it++); 6396 } 6397 else 6398 it++; 6399 } 6400 } 6408 else if ( aReason == Reason_HostSuspend 6409 || aReason == Reason_HostBatteryLow) 6410 i_removeSecretKeysOnSuspend(); 6401 6411 6402 6412 LogFlowThisFunc(("hrc=%Rhrc\n", hrc)); … … 10180 10190 throw rc; 10181 10191 10182 /* 10183 * don't release the lock since reconfigureMediumAttachment 10184 * isn't going to need the Console lock. 10185 */ 10186 10187 /* TODO: do alock.release here as EMT might wait on it! See other places 10188 * where we do VMR3ReqCall requests. See @bugref{7648}. */ 10192 alock.release(); 10189 10193 vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY, 10190 10194 (PFNRT)i_reconfigureMediumAttachment, 13, … … 10192 10196 fBuiltinIOCache, false /* fSetupMerge */, 0 /* uMergeSource */, 10193 10197 0 /* uMergeTarget */, atts[i], that->mMachineState, &rc); 10198 alock.acquire(); 10194 10199 if (RT_FAILURE(vrc)) 10195 10200 throw i_setErrorStatic(E_FAIL, Console::tr("%Rrc"), vrc);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器