- Timestamp:
- Dec 14, 2018 8:34:20 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127510
- Location:
- trunk/src/VBox/Main
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r76215 r76240 23725 23725 The given medium was registered or unregistered 23726 23726 within this VirtualBox installation. 23727 <note>This event is not yet implemented.</note> 23727 23728 </desc> 23728 23729 … … 23751 23752 The configuration of the given medium was changed (location, properties, 23752 23753 child/parent or anything else). 23754 <note>This event is not yet implemented.</note> 23753 23755 </desc> 23754 23756 … … 24142 24144 <link to="IMachine::mediumAttachments">medium attachment</link> 24143 24145 changes. 24146 <note>This event is not yet implemented.</note> 24144 24147 </desc> 24145 24148 <attribute name="mediumAttachment" type="IMediumAttachment" readonly="yes"> -
trunk/src/VBox/Main/include/MediumImpl.h
r76215 r76240 169 169 MediumLockList *pMediumLockList, 170 170 ComObjPtr<Progress> *aProgress, 171 bool aWait, 172 bool aNotify); 171 bool aWait); 173 172 Utf8Str i_getPreferredDiffFormat(); 174 173 MediumVariant_T i_getPreferredDiffVariant(); … … 177 176 HRESULT i_unlockRead(MediumState_T *aState); 178 177 HRESULT i_unlockWrite(MediumState_T *aState); 179 HRESULT i_deleteStorage(ComObjPtr<Progress> *aProgress, bool aWait , bool aNotify);178 HRESULT i_deleteStorage(ComObjPtr<Progress> *aProgress, bool aWait); 180 179 HRESULT i_markForDeletion(); 181 180 HRESULT i_unmarkForDeletion(); … … 200 199 MediumLockList *aMediumLockList, 201 200 ComObjPtr<Progress> *aProgress, 202 bool aWait, 203 bool aNotify); 201 bool aWait); 204 202 void i_cancelMergeTo(MediumLockList *aChildrenToReparent, 205 203 MediumLockList *aMediumLockList); … … 208 206 MediumLockList *aMediumLockList, 209 207 ComObjPtr<Progress> *aProgress, 210 bool aWait, 211 bool aNotify); 208 bool aWait); 212 209 213 210 HRESULT i_fixParentUuidOfChildren(MediumLockList *pChildrenToReparent); … … 223 220 const ComObjPtr<Progress> &aProgress); 224 221 HRESULT i_importFile(const char *aFilename, 225 const ComObjPtr<MediumFormat> &aFormat, 226 MediumVariant_T aVariant, 227 RTVFSIOSTREAM hVfsIosSrc, 228 const ComObjPtr<Medium> &aParent, 229 const ComObjPtr<Progress> &aProgress, 230 bool aNotify); 222 const ComObjPtr<MediumFormat> &aFormat, 223 MediumVariant_T aVariant, 224 RTVFSIOSTREAM hVfsIosSrc, 225 const ComObjPtr<Medium> &aParent, 226 const ComObjPtr<Progress> &aProgress); 231 227 232 228 HRESULT i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant, 233 229 const ComObjPtr<Medium> &aParent, IProgress **aProgress, 234 uint32_t idxSrcImageSame, uint32_t idxDstImageSame , bool aNotify);230 uint32_t idxSrcImageSame, uint32_t idxDstImageSame); 235 231 236 232 const Utf8Str& i_getKeyId(); -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r76215 r76240 150 150 int i_unloadVDPlugin(const char *pszPluginLibrary); 151 151 152 void i_onMediumRegistered(const Guid &aMediumId, const DeviceType_T aDevType, const BOOL aRegistered);153 void i_onMediumConfigChanged(IMedium *aMedium);154 void i_onMediumChanged(IMediumAttachment* aMediumAttachment);155 void i_onStorageDeviceChanged(IMediumAttachment* aStorageDevice, const BOOL fRemoved, const BOOL fSilent);156 152 void i_onMachineStateChange(const Guid &aId, MachineState_T aState); 157 153 void i_onMachineDataChange(const Guid &aId, BOOL aTemporary = FALSE); -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r76215 r76240 2641 2641 hVfsIosReadAhead, 2642 2642 nullParent, 2643 pProgressImportTmp, 2644 true /* aNotify */); 2643 pProgressImportTmp); 2645 2644 RTVfsIoStrmRelease(hVfsIosReadAhead); 2646 2645 hVfsIosSrc = NIL_RTVFSIOSTREAM; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r76215 r76240 4037 4037 pMediumLockList, 4038 4038 NULL /* aProgress */, 4039 true /* aWait */, 4040 false /* aNotify */); 4039 true /* aWait */); 4041 4040 4042 4041 alock.acquire(); … … 4146 4145 mParent->i_saveModifiedRegistries(); 4147 4146 4148 if (aM)4149 mParent->i_onMediumConfigChanged(aM);4150 4147 return rc; 4151 4148 } … … 10822 10819 pMediumLockList, 10823 10820 NULL /* aProgress */, 10824 true /* aWait */, 10825 false /* aNotify */); 10821 true /* aWait */); 10826 10822 alock.acquire(); 10827 10823 if (FAILED(rc)) throw rc; … … 11059 11055 Assert(pMedium); 11060 11056 11061 rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/ , false /*aNotify*/);11057 rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/); 11062 11058 // continue on delete failure, just collect error messages 11063 11059 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(), … … 11227 11223 11228 11224 HRESULT rc = oldmedium->i_deleteStorage(NULL /*aProgress*/, 11229 true /*aWait*/, 11230 false /*aNotify*/); 11225 true /*aWait*/); 11231 11226 11232 11227 writeLock.acquire(); … … 14028 14023 } 14029 14024 14030 mParent->i_onMediumChanged(aAttachment);14031 14032 14025 /* ignore notifications sent after #OnSessionEnd() is called */ 14033 14026 if (!directControl) … … 14266 14259 directControl = mData->mSession.mDirectControl; 14267 14260 } 14268 14269 mParent->i_onStorageDeviceChanged(aAttachment, aRemove, aSilent);14270 14261 14271 14262 /* ignore notifications sent after #OnSessionEnd() is called */ -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r76215 r76240 16 16 */ 17 17 18 #include <set>19 #include <map>20 18 #include "MachineImplCloneVM.h" 21 19 … … 732 730 pMediumLockList, 733 731 NULL /* aProgress */, 734 true /* aWait */, 735 false /* aNotify */); 732 true /* aWait */); 736 733 delete pMediumLockList; 737 734 if (FAILED(rc)) throw rc; … … 1019 1016 RTCList<ComObjPtr<Medium> > newMedia; /* All created images */ 1020 1017 RTCList<Utf8Str> newFiles; /* All extra created files (save states, ...) */ 1021 std::set<ComObjPtr<Medium> > pMediumsForNotify;1022 std::map<Guid, DeviceType_T> uIdsForNotify;1023 1018 try 1024 1019 { … … 1158 1153 /* diff image has to be used... */ 1159 1154 pNewParent = pDiff; 1160 pMediumsForNotify.insert(pDiff->i_getParent());1161 uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType();1162 1155 } 1163 1156 else … … 1291 1284 progress2.asOutParam(), 1292 1285 uSrcParentIdx, 1293 uTrgParentIdx, 1294 false /* aNotify */); 1286 uTrgParentIdx); 1295 1287 srcLock.acquire(); 1296 1288 if (FAILED(rc)) throw rc; … … 1326 1318 * chain. */ 1327 1319 pNewParent = pTarget; 1328 uIdsForNotify[pTarget->i_getId()] = pTarget->i_getDeviceType();1329 1320 } 1330 1321 } … … 1365 1356 /* diff image has to be used... */ 1366 1357 pNewParent = pDiff; 1367 pMediumsForNotify.insert(pDiff->i_getParent());1368 uIdsForNotify[pDiff->i_getId()] = pDiff->i_getDeviceType();1369 1358 } 1370 1359 else … … 1545 1534 const ComObjPtr<Medium> &pMedium = newMedia.at(i - 1); 1546 1535 mrc = pMedium->i_deleteStorage(NULL /* aProgress */, 1547 true /* aWait */, 1548 false /* aNotify */); 1536 true /* aWait */); 1549 1537 pMedium->Close(); 1550 1538 } … … 1558 1546 p->mParent->i_saveModifiedRegistries(); 1559 1547 } 1560 else1561 {1562 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();1563 it != uIdsForNotify.end();1564 ++it)1565 {1566 p->mParent->i_onMediumRegistered(it->first, it->second, TRUE);1567 }1568 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();1569 it != pMediumsForNotify.end();1570 ++it)1571 {1572 if (it->isNotNull())1573 p->mParent->i_onMediumConfigChanged(*it);1574 }1575 }1576 1548 1577 1549 return mrc; -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r76239 r76240 46 46 #include <algorithm> 47 47 #include <list> 48 #include <set>49 #include <map>50 48 51 49 … … 224 222 { 225 223 public: 226 Task(Medium *aMedium, Progress *aProgress , bool fNotifyAboutChanges = true)224 Task(Medium *aMedium, Progress *aProgress) 227 225 : ThreadTask("Medium::Task"), 228 226 mVDOperationIfaces(NULL), … … 230 228 mMediumCaller(aMedium), 231 229 mProgress(aProgress), 232 mVirtualBoxCaller(NULL), 233 mNotifyAboutChanges(fNotifyAboutChanges) 230 mVirtualBoxCaller(NULL) 234 231 { 235 232 AssertReturnVoidStmt(aMedium, mRC = E_FAIL); … … 274 271 HRESULT rc() const { return mRC; } 275 272 bool isOk() const { return SUCCEEDED(rc()); } 276 bool NotifyAboutChanges() const { return mNotifyAboutChanges; }277 273 278 274 const ComPtr<Progress>& GetProgressObject() const {return mProgress;} … … 335 331 ComObjPtr<VirtualBox> mVirtualBox; 336 332 AutoCaller mVirtualBoxCaller; 337 bool mNotifyAboutChanges;338 333 }; 339 334 … … 349 344 Progress *aProgress, 350 345 uint64_t aSize, 351 MediumVariant_T aVariant, 352 bool fNotifyAboutChanges = true) 353 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 346 MediumVariant_T aVariant) 347 : Medium::Task(aMedium, aProgress), 354 348 mSize(aSize), 355 349 mVariant(aVariant) … … 373 367 MediumVariant_T aVariant, 374 368 MediumLockList *aMediumLockList, 375 bool fKeepMediumLockList = false, 376 bool fNotifyAboutChanges = true) 377 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 369 bool fKeepMediumLockList = false) 370 : Medium::Task(aMedium, aProgress), 378 371 mpMediumLockList(aMediumLockList), 379 372 mTarget(aTarget), … … 419 412 MediumLockList *aTargetMediumLockList, 420 413 bool fKeepSourceMediumLockList = false, 421 bool fKeepTargetMediumLockList = false, 422 bool fNotifyAboutChanges = true) 423 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 414 bool fKeepTargetMediumLockList = false) 415 : Medium::Task(aMedium, aProgress), 424 416 mTarget(aTarget), 425 417 mParent(aParent), … … 478 470 MediumVariant_T aVariant, 479 471 MediumLockList *aMediumLockList, 480 bool fKeepMediumLockList = false, 481 bool fNotifyAboutChanges = true) 482 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 472 bool fKeepMediumLockList = false) 473 : Medium::Task(aMedium, aProgress), 483 474 mpMediumLockList(aMediumLockList), 484 475 mVariant(aVariant), … … 509 500 Progress *aProgress, 510 501 MediumLockList *aMediumLockList, 511 bool fKeepMediumLockList = false, 512 bool fNotifyAboutChanges = true) 513 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 502 bool fKeepMediumLockList = false) 503 : Medium::Task(aMedium, aProgress), 514 504 mpMediumLockList(aMediumLockList), 515 505 mfKeepMediumLockList(fKeepMediumLockList) … … 539 529 Progress *aProgress, 540 530 MediumLockList *aMediumLockList, 541 bool fKeepMediumLockList = false, 542 bool fNotifyAboutChanges = true) 543 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 531 bool fKeepMediumLockList = false) 532 : Medium::Task(aMedium, aProgress), 544 533 mSize(aSize), 545 534 mpMediumLockList(aMediumLockList), … … 570 559 Progress *aProgress, 571 560 MediumLockList *aMediumLockList, 572 bool fKeepMediumLockList = false, 573 bool fNotifyAboutChanges = true) 574 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 561 bool fKeepMediumLockList = false) 562 : Medium::Task(aMedium, aProgress), 575 563 mpMediumLockList(aMediumLockList), 576 564 mfKeepMediumLockList(fKeepMediumLockList) … … 598 586 Progress *aProgress, 599 587 MediumLockList *aMediumLockList, 600 bool fKeepMediumLockList = false, 601 bool fNotifyAboutChanges = true) 602 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 588 bool fKeepMediumLockList = false) 589 : Medium::Task(aMedium, aProgress), 603 590 mpMediumLockList(aMediumLockList), 604 591 mfKeepMediumLockList(fKeepMediumLockList) … … 630 617 Progress *aProgress, 631 618 MediumLockList *aMediumLockList, 632 bool fKeepMediumLockList = false, 633 bool fNotifyAboutChanges = true) 634 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 619 bool fKeepMediumLockList = false) 620 : Medium::Task(aMedium, aProgress), 635 621 mTarget(aTarget), 636 622 mfMergeForward(fMergeForward), … … 680 666 Medium *aParent, 681 667 MediumLockList *aTargetMediumLockList, 682 bool fKeepTargetMediumLockList = false, 683 bool fNotifyAboutChanges = true) 684 : Medium::Task(aMedium, aProgress, fNotifyAboutChanges), 668 bool fKeepTargetMediumLockList = false) 669 : Medium::Task(aMedium, aProgress), 685 670 mFilename(aFilename), 686 671 mFormat(aFormat), … … 745 730 Progress *aProgress, 746 731 MediumLockList *aMediumLockList) 747 : Medium::Task(aMedium, aProgress , false),732 : Medium::Task(aMedium, aProgress), 748 733 mstrNewPassword(strNewPassword), 749 734 mstrCurrentPassword(strCurrentPassword), … … 1659 1644 i_markRegistriesModified(); 1660 1645 m->pVirtualBox->i_saveModifiedRegistries(); 1661 m->pVirtualBox->i_onMediumConfigChanged(this);1662 1646 } 1663 1647 catch (HRESULT aRC) { rc = aRC; } … … 1895 1879 i_markRegistriesModified(); 1896 1880 m->pVirtualBox->i_saveModifiedRegistries(); 1897 m->pVirtualBox->i_onMediumConfigChanged(this);1898 1881 1899 1882 return S_OK; … … 2007 1990 i_markRegistriesModified(); 2008 1991 m->pVirtualBox->i_saveModifiedRegistries(); 2009 m->pVirtualBox->i_onMediumConfigChanged(this);2010 1992 } 2011 1993 … … 2074 2056 } 2075 2057 2076 const Guid uPrevImage = m->uuidImage;2077 2058 unconst(m->uuidImage) = imageId; 2078 ComObjPtr<Medium> pPrevParent = i_getParent();2079 2059 unconst(m->uuidParentImage) = parentId; 2080 2060 … … 2085 2065 !!aSetParentId /* fSetParentId */, 2086 2066 autoCaller); 2087 2088 AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);2089 const Guid uCurrImage = m->uuidImage;2090 ComObjPtr<Medium> pCurrParent = i_getParent();2091 arlock.release();2092 2093 if (SUCCEEDED(rc))2094 {2095 if (uCurrImage != uPrevImage)2096 m->pVirtualBox->i_onMediumConfigChanged(this);2097 if (pPrevParent != pCurrParent)2098 {2099 m->pVirtualBox->i_onMediumConfigChanged(pPrevParent);2100 m->pVirtualBox->i_onMediumConfigChanged(pCurrParent);2101 }2102 }2103 2067 2104 2068 return rc; … … 2394 2358 ComObjPtr<VirtualBox> pVirtualBox(m->pVirtualBox); 2395 2359 2396 Guid uId = i_getId();2397 DeviceType_T devType = i_getDeviceType();2398 bool wasCreated = m->state != MediumState_NotCreated;2399 2360 MultiResult mrc = i_close(aAutoCaller); 2400 2361 2401 2362 pVirtualBox->i_saveModifiedRegistries(); 2402 2403 if (SUCCEEDED(mrc) && wasCreated)2404 pVirtualBox->i_onMediumRegistered(uId, devType, FALSE);2405 2363 2406 2364 return mrc; … … 2472 2430 i_markRegistriesModified(); 2473 2431 m->pVirtualBox->i_saveModifiedRegistries(); 2474 m->pVirtualBox->i_onMediumConfigChanged(this);2475 2432 2476 2433 return S_OK; … … 2552 2509 i_markRegistriesModified(); 2553 2510 m->pVirtualBox->i_saveModifiedRegistries(); 2554 m->pVirtualBox->i_onMediumConfigChanged(this);2555 2511 2556 2512 return S_OK; 2557 2513 } 2558 2559 2514 HRESULT Medium::createBaseStorage(LONG64 aLogicalSize, 2560 2515 const std::vector<MediumVariant_T> &aVariant, … … 2642 2597 2643 2598 MultiResult mrc = i_deleteStorage(&pProgress, 2644 false /* aWait */, 2645 true /* aNotify */); 2599 false /* aWait */); 2646 2600 /* Must save the registries in any case, since an entry was removed. */ 2647 2601 m->pVirtualBox->i_saveModifiedRegistries(); … … 2762 2716 2763 2717 rc = i_createDiffStorage(diff, (MediumVariant_T)mediumVariantFlags, pMediumLockList, 2764 &pProgress, false /* aWait */ , true /* aNotify */);2718 &pProgress, false /* aWait */); 2765 2719 if (FAILED(rc)) 2766 2720 delete pMediumLockList; … … 2794 2748 2795 2749 rc = i_mergeTo(pTarget, fMergeForward, pParentForTarget, pChildrenToReparent, 2796 pMediumLockList, &pProgress, false /* aWait */ , true /* aNotify */);2750 pMediumLockList, &pProgress, false /* aWait */); 2797 2751 if (FAILED(rc)) 2798 2752 i_cancelMergeTo(pChildrenToReparent, pMediumLockList); … … 3345 3299 MediumState_T mediumState; 3346 3300 refreshState(autoCaller, &mediumState); 3347 m->pVirtualBox->i_onMediumConfigChanged(this);3348 3301 } 3349 3302 catch (HRESULT aRC) { rc = aRC; } … … 3473 3426 3474 3427 if (SUCCEEDED(rc)) 3475 rc = i_resize(aLogicalSize, pMediumLockList, &pProgress, false /* aWait */ , true /* aNotify */);3428 rc = i_resize(aLogicalSize, pMediumLockList, &pProgress, false /* aWait */); 3476 3429 3477 3430 if (SUCCEEDED(rc)) … … 4526 4479 unconst(m->strLocationFull) = newPath; 4527 4480 4528 m->pVirtualBox->i_onMediumConfigChanged(this);4529 4530 4481 LogFlowThisFunc(("locationFull.after='%s'\n", m->strLocationFull.c_str())); 4531 4482 // we changed something … … 4674 4625 4675 4626 /** 4676 * Internal method to update the medium's id. Must have caller + locking!4627 * Internal method to return the medium's size. Must have caller + locking! 4677 4628 * @return 4678 4629 */ … … 4920 4871 * @param aWait @c true if this method should block instead of 4921 4872 * creating an asynchronous thread. 4922 * @param aNotify Notify about mediums which metadatа are changed4923 * during execution of the function.4924 4873 * 4925 4874 * @note Locks this object and @a aTarget for writing. … … 4929 4878 MediumLockList *aMediumLockList, 4930 4879 ComObjPtr<Progress> *aProgress, 4931 bool aWait, 4932 bool aNotify) 4880 bool aWait) 4933 4881 { 4934 4882 AssertReturn(!aTarget.isNull(), E_FAIL); … … 5005 4953 pTask = new Medium::CreateDiffTask(this, pProgress, aTarget, aVariant, 5006 4954 aMediumLockList, 5007 aWait /* fKeepMediumLockList */, 5008 aNotify); 4955 aWait /* fKeepMediumLockList */); 5009 4956 rc = pTask->rc(); 5010 4957 AssertComRC(rc); … … 5186 5133 * @param aWait @c true if this method should block instead of creating 5187 5134 * an asynchronous thread. 5188 * @param aNotify Notify about mediums which metadatа are changed5189 * during execution of the function.5190 5135 * 5191 5136 * @note Locks mVirtualBox and this object for writing. Locks medium tree for … … 5193 5138 */ 5194 5139 HRESULT Medium::i_deleteStorage(ComObjPtr<Progress> *aProgress, 5195 bool aWait , bool aNotify)5140 bool aWait) 5196 5141 { 5197 5142 AssertReturn(aProgress != NULL || aWait == true, E_FAIL); … … 5364 5309 5365 5310 /* setup task object to carry out the operation sync/async */ 5366 pTask = new Medium::DeleteTask(this, pProgress, pMediumLockList , false, aNotify);5311 pTask = new Medium::DeleteTask(this, pProgress, pMediumLockList); 5367 5312 rc = pTask->rc(); 5368 5313 AssertComRC(rc); … … 6009 5954 * @param aWait @c true if this method should block instead of creating 6010 5955 * an asynchronous thread. 6011 * @param aNotify Notify about mediums which metadatа are changed6012 * during execution of the function.6013 5956 * 6014 5957 * @note Locks the tree lock for writing. Locks the media from the chain … … 6021 5964 MediumLockList *aMediumLockList, 6022 5965 ComObjPtr<Progress> *aProgress, 6023 bool aWait , bool aNotify)5966 bool aWait) 6024 5967 { 6025 5968 AssertReturn(pTarget != NULL, E_FAIL); … … 6076 6019 pParentForTarget, aChildrenToReparent, 6077 6020 pProgress, aMediumLockList, 6078 aWait /* fKeepMediumLockList */, 6079 aNotify); 6021 aWait /* fKeepMediumLockList */); 6080 6022 rc = pTask->rc(); 6081 6023 AssertComRC(rc); … … 6192 6134 * @param aWait @c true if this method should block instead of creating 6193 6135 * an asynchronous thread. 6194 * @param aNotify Notify about mediums which metadatа are changed6195 * during execution of the function.6196 6136 * 6197 6137 * @note Locks the media from the chain for writing. … … 6201 6141 MediumLockList *aMediumLockList, 6202 6142 ComObjPtr<Progress> *aProgress, 6203 bool aWait, 6204 bool aNotify) 6143 bool aWait) 6205 6144 { 6206 6145 AssertReturn(aMediumLockList != NULL, E_FAIL); … … 6241 6180 pProgress, 6242 6181 aMediumLockList, 6243 aWait /* fKeepMediumLockList */, 6244 aNotify); 6182 aWait /* fKeepMediumLockList */); 6245 6183 rc = pTask->rc(); 6246 6184 AssertComRC(rc); … … 6545 6483 * @param aParent Parent medium. May be NULL. 6546 6484 * @param aProgress Progress object to use. 6547 * @param aNotify Notify about mediums which metadatа are changed6548 * during execution of the function.6549 6485 * @return 6550 6486 * @note The destination format is defined by the Medium instance. … … 6560 6496 RTVFSIOSTREAM aVfsIosSrc, 6561 6497 const ComObjPtr<Medium> &aParent, 6562 const ComObjPtr<Progress> &aProgress, 6563 bool aNotify) 6498 const ComObjPtr<Progress> &aProgress) 6564 6499 { 6565 6500 /** @todo r=klaus The code below needs to be double checked with regard … … 6622 6557 /* setup task object to carry out the operation asynchronously */ 6623 6558 pTask = new Medium::ImportTask(this, aProgress, aFilename, aFormat, aVariant, 6624 aVfsIosSrc, aParent, pTargetMediumLockList , false, aNotify);6559 aVfsIosSrc, aParent, pTargetMediumLockList); 6625 6560 rc = pTask->rc(); 6626 6561 AssertComRC(rc); … … 6656 6591 * same content as the given image in the source chain. 6657 6592 * Use UINT32_MAX to disable this optimization. 6658 * @param aNotify Notify about mediums which metadatа are changed6659 * during execution of the function.6660 6593 * @return 6661 6594 */ 6662 6595 HRESULT Medium::i_cloneToEx(const ComObjPtr<Medium> &aTarget, MediumVariant_T aVariant, 6663 6596 const ComObjPtr<Medium> &aParent, IProgress **aProgress, 6664 uint32_t idxSrcImageSame, uint32_t idxDstImageSame , bool aNotify)6597 uint32_t idxSrcImageSame, uint32_t idxDstImageSame) 6665 6598 { 6666 6599 /** @todo r=klaus The code below needs to be double checked with regard … … 6767 6700 aParent, idxSrcImageSame, 6768 6701 idxDstImageSame, pSourceMediumLockList, 6769 pTargetMediumLockList , false, false, aNotify);6702 pTargetMediumLockList); 6770 6703 rc = pTask->rc(); 6771 6704 AssertComRC(rc); … … 7367 7300 pToken.setNull(); 7368 7301 7369 if (FAILED(rc)) 7370 return rc; 7302 if (FAILED(rc)) return rc; 7371 7303 7372 7304 /* If this is a base image which incorrectly has a parent UUID set, … … 7376 7308 * with a diff image before the base is registered this would destroy 7377 7309 * the diff. Not acceptable. */ 7378 do 7379 { 7380 if (fRepairImageZeroParentUuid) 7381 { 7382 rc = LockWrite(pToken.asOutParam()); 7383 if (FAILED(rc)) 7384 break; 7385 7386 alock.release(); 7310 if (fRepairImageZeroParentUuid) 7311 { 7312 rc = LockWrite(pToken.asOutParam()); 7313 if (FAILED(rc)) return rc; 7314 7315 alock.release(); 7316 7317 try 7318 { 7319 PVDISK hdd; 7320 vrc = VDCreate(m->vdDiskIfaces, i_convertDeviceType(), &hdd); 7321 ComAssertRCThrow(vrc, E_FAIL); 7387 7322 7388 7323 try 7389 7324 { 7390 PVDISK hdd; 7391 vrc = VDCreate(m->vdDiskIfaces, i_convertDeviceType(), &hdd); 7325 vrc = VDOpen(hdd, 7326 format.c_str(), 7327 location.c_str(), 7328 (uOpenFlags & ~VD_OPEN_FLAGS_READONLY) | m->uOpenFlagsDef, 7329 m->vdImageIfaces); 7330 if (RT_FAILURE(vrc)) 7331 throw S_OK; 7332 7333 RTUUID zeroParentUuid; 7334 RTUuidClear(&zeroParentUuid); 7335 vrc = VDSetParentUuid(hdd, 0, &zeroParentUuid); 7392 7336 ComAssertRCThrow(vrc, E_FAIL); 7393 7394 try7395 {7396 vrc = VDOpen(hdd,7397 format.c_str(),7398 location.c_str(),7399 (uOpenFlags & ~VD_OPEN_FLAGS_READONLY) | m->uOpenFlagsDef,7400 m->vdImageIfaces);7401 if (RT_FAILURE(vrc))7402 throw S_OK;7403 7404 RTUUID zeroParentUuid;7405 RTUuidClear(&zeroParentUuid);7406 vrc = VDSetParentUuid(hdd, 0, &zeroParentUuid);7407 ComAssertRCThrow(vrc, E_FAIL);7408 }7409 catch (HRESULT aRC)7410 {7411 rc = aRC;7412 }7413 7414 VDDestroy(hdd);7415 7337 } 7416 7338 catch (HRESULT aRC) … … 7419 7341 } 7420 7342 7421 pToken->Abandon(); 7422 pToken.setNull(); 7423 if (FAILED(rc)) 7424 break; 7425 } 7426 } while(0); 7343 VDDestroy(hdd); 7344 } 7345 catch (HRESULT aRC) 7346 { 7347 rc = aRC; 7348 } 7349 7350 pToken->Abandon(); 7351 pToken.setNull(); 7352 if (FAILED(rc)) return rc; 7353 } 7427 7354 7428 7355 return rc; … … 8566 8493 m->pVirtualBox->i_saveModifiedRegistries(); 8567 8494 } 8568 if (task.NotifyAboutChanges())8569 m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);8570 8495 } 8571 8496 else … … 8803 8728 * unlock the medium. */ 8804 8729 8805 if (task.NotifyAboutChanges() && SUCCEEDED(mrc))8806 {8807 m->pVirtualBox->i_onMediumRegistered(pTarget->i_getId(), pTarget->i_getDeviceType(), TRUE);8808 m->pVirtualBox->i_onMediumConfigChanged(this);8809 }8810 8811 8730 return mrc; 8812 8731 } … … 8901 8820 8902 8821 ComObjPtr<Progress> pProgress(task.GetProgressObject()); 8903 rc = pTarget->i_resize(sourceSize, pMediumLockListForResize, &pProgress, true , false);8822 rc = pTarget->i_resize(sourceSize, pMediumLockListForResize, &pProgress, true); 8904 8823 if (FAILED(rc)) 8905 8824 { … … 9067 8986 HRESULT rc2; 9068 8987 9069 std::set<ComObjPtr<Medium> > pMediumsForNotify;9070 std::map<Guid, DeviceType_T> uIdsForNotify;9071 9072 8988 if (SUCCEEDED(mrc)) 9073 8989 { … … 9089 9005 pTarget->i_setParent(task.mParentForTarget); 9090 9006 if (task.mParentForTarget) 9091 {9092 9007 i_deparent(); 9093 if (task.NotifyAboutChanges())9094 pMediumsForNotify.insert(task.mParentForTarget);9095 }9096 9008 9097 9009 /* then, register again */ … … 9128 9040 // no depth check, reduces depth 9129 9041 pMedium->i_setParent(pTarget); 9130 9131 if (task.NotifyAboutChanges())9132 pMediumsForNotify.insert(pMedium);9133 9042 } 9134 9043 } 9135 pMediumsForNotify.insert(pTarget);9136 9044 } 9137 9045 … … 9158 9066 } 9159 9067 9160 uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();9161 9068 rc2 = pMedium->m->pVirtualBox->i_unregisterMedium(pMedium); 9162 9069 AssertComRC(rc2); … … 9219 9126 if (task.isAsync()) 9220 9127 i_cancelMergeTo(task.mpChildrenToReparent, task.mpMediumLockList); 9221 }9222 else if (task.NotifyAboutChanges())9223 {9224 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();9225 it != pMediumsForNotify.end();9226 ++it)9227 {9228 if (it->isNotNull())9229 m->pVirtualBox->i_onMediumConfigChanged(*it);9230 }9231 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();9232 it != uIdsForNotify.end();9233 ++it)9234 {9235 m->pVirtualBox->i_onMediumRegistered(it->first, it->second, FALSE);9236 }9237 9128 } 9238 9129 … … 9555 9446 m->pVirtualBox->i_saveModifiedRegistries(); 9556 9447 eik.fetch(); 9557 9558 if (task.NotifyAboutChanges())9559 {9560 if (!fCreatingTarget)9561 {9562 if (!aFilterPropNames.empty())9563 m->pVirtualBox->i_onMediumConfigChanged(pTargetBase);9564 m->pVirtualBox->i_onMediumConfigChanged(pParent);9565 }9566 else9567 {9568 m->pVirtualBox->i_onMediumRegistered(pTarget->i_getId(), pTarget->i_getDeviceType(), TRUE);9569 }9570 }9571 9448 } 9572 9449 } … … 9744 9621 task.mpMediumLockList->Clear(); 9745 9622 9746 if (task.NotifyAboutChanges() && SUCCEEDED(mrc))9747 m->pVirtualBox->i_onMediumConfigChanged(this);9748 9623 return mrc; 9749 9624 } … … 9813 9688 /* Reset UUID to prevent Create* from reusing it again */ 9814 9689 unconst(m->id).clear(); 9815 9816 if (task.NotifyAboutChanges() && SUCCEEDED(rc) && m->pParent.isNotNull())9817 m->pVirtualBox->i_onMediumConfigChanged(m->pParent);9818 9690 9819 9691 return rc; … … 9959 9831 m->logicalSize = logicalSize; 9960 9832 m->variant = variant; 9961 9962 if (task.NotifyAboutChanges() && SUCCEEDED(rc))9963 m->pVirtualBox->i_onMediumConfigChanged(this);9964 9833 9965 9834 /* Everything is explicitly unlocked when the task exits, … … 10059 9928 } 10060 9929 catch (HRESULT aRC) { rc = aRC; } 10061 10062 if (task.NotifyAboutChanges() && SUCCEEDED(rc))10063 m->pVirtualBox->i_onMediumConfigChanged(this);10064 9930 10065 9931 /* Everything is explicitly unlocked when the task exits, … … 10178 10044 m->size = size; 10179 10045 m->logicalSize = logicalSize; 10180 10181 if (task.NotifyAboutChanges())10182 m->pVirtualBox->i_onMediumConfigChanged(this);10183 10046 } 10184 10047 … … 10449 10312 task.mpTargetMediumLockList->Clear(); 10450 10313 10451 if (task.NotifyAboutChanges() && SUCCEEDED(mrc))10452 {10453 if (pParent)10454 m->pVirtualBox->i_onMediumConfigChanged(pParent);10455 if (fCreatingTarget)10456 m->pVirtualBox->i_onMediumConfigChanged(this);10457 else10458 m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);10459 }10460 10461 10314 return mrc; 10462 10315 } -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r76239 r76240 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 18 #include <set>19 #include <map>20 17 21 18 #include "Logging.h" … … 1640 1637 BOOL fSuspendedBySave = FALSE; 1641 1638 1642 std::set<ComObjPtr<Medium> > pMediumsForNotify;1643 std::map<Guid, DeviceType_T> uIdsForNotify;1644 1645 1639 try 1646 1640 { … … 1779 1773 if (FAILED(rc)) 1780 1774 throw rc; 1781 }1782 1783 // store parent of newly created diffs before commit for notify1784 {1785 MediumAttachmentList &oldAtts = *mMediumAttachments.backedUpData();1786 for (MediumAttachmentList::const_iterator1787 it = mMediumAttachments->begin();1788 it != mMediumAttachments->end();1789 ++it)1790 {1791 MediumAttachment *pAttach = *it;1792 Medium *pMedium = pAttach->i_getMedium();1793 if (!pMedium)1794 continue;1795 1796 bool fFound = false;1797 /* was this medium attached before? */1798 for (MediumAttachmentList::iterator1799 oldIt = oldAtts.begin();1800 oldIt != oldAtts.end();1801 ++oldIt)1802 {1803 MediumAttachment *pOldAttach = *oldIt;1804 if (pOldAttach->i_getMedium() == pMedium)1805 {1806 fFound = true;1807 break;1808 }1809 }1810 if (!fFound)1811 {1812 pMediumsForNotify.insert(pMedium->i_getParent());1813 uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();1814 }1815 }1816 1775 } 1817 1776 … … 1917 1876 if (SUCCEEDED(rc)) 1918 1877 mParent->i_onSnapshotTaken(mData->mUuid, task.m_uuidSnapshot); 1919 1920 if (SUCCEEDED(rc))1921 {1922 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();1923 it != uIdsForNotify.end();1924 ++it)1925 {1926 mParent->i_onMediumRegistered(it->first, it->second, TRUE);1927 }1928 1929 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();1930 it != pMediumsForNotify.end();1931 ++it)1932 {1933 if (it->isNotNull())1934 mParent->i_onMediumConfigChanged(*it);1935 }1936 }1937 1878 LogFlowThisFuncLeave(); 1938 1879 } … … 2179 2120 HRESULT rc = S_OK; 2180 2121 Guid snapshotId; 2181 std::set<ComObjPtr<Medium> > pMediumsForNotify;2182 std::map<Guid, DeviceType_T> uIdsForNotify;2183 2122 2184 2123 try … … 2275 2214 /* make the snapshot we restored from the current snapshot */ 2276 2215 mData->mCurrentSnapshot = task.m_pSnapshot; 2277 }2278 2279 // store parent of newly created diffs for notify2280 {2281 MediumAttachmentList &oldAtts = *mMediumAttachments.backedUpData();2282 for (MediumAttachmentList::const_iterator2283 it = mMediumAttachments->begin();2284 it != mMediumAttachments->end();2285 ++it)2286 {2287 MediumAttachment *pAttach = *it;2288 Medium *pMedium = pAttach->i_getMedium();2289 if (!pMedium)2290 continue;2291 2292 bool fFound = false;2293 /* was this medium attached before? */2294 for (MediumAttachmentList::iterator2295 oldIt = oldAtts.begin();2296 oldIt != oldAtts.end();2297 ++oldIt)2298 {2299 MediumAttachment *pOldAttach = *oldIt;2300 if (pOldAttach->i_getMedium() == pMedium)2301 {2302 fFound = true;2303 break;2304 }2305 }2306 if (!fFound)2307 {2308 pMediumsForNotify.insert(pMedium->i_getParent());2309 uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();2310 }2311 }2312 2216 } 2313 2217 … … 2410 2314 LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium->i_getName().c_str())); 2411 2315 2412 ComObjPtr<Medium> pParent = pMedium->i_getParent();2413 2316 HRESULT rc2 = pMedium->i_deleteStorage(NULL /* aProgress */, 2414 true /* aWait */, 2415 false /* aNotify */); 2317 true /* aWait */); 2416 2318 // ignore errors here because we cannot roll back after i_saveSettings() above 2417 2319 if (SUCCEEDED(rc2)) 2418 {2419 pMediumsForNotify.insert(pParent);2420 2320 pMedium->uninit(); 2421 }2422 2321 } 2423 2322 } … … 2446 2345 2447 2346 if (SUCCEEDED(rc)) 2448 {2449 2347 mParent->i_onSnapshotRestored(mData->mUuid, snapshotId); 2450 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();2451 it != uIdsForNotify.end();2452 ++it)2453 {2454 mParent->i_onMediumRegistered(it->first, it->second, TRUE);2455 }2456 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();2457 it != pMediumsForNotify.end();2458 ++it)2459 {2460 if (it->isNotNull())2461 mParent->i_onMediumConfigChanged(*it);2462 }2463 }2464 2348 2465 2349 LogFlowThisFunc(("Done restoring snapshot (rc=%08X)\n", rc)); … … 2812 2696 MediumDeleteRecList toDelete; 2813 2697 Guid snapshotId; 2814 std::set<ComObjPtr<Medium> > pMediumsForNotify;2815 std::map<Guid,DeviceType_T> uIdsForNotify;2816 2698 2817 2699 try … … 3188 3070 /* No need to hold the lock any longer. */ 3189 3071 mLock.release(); 3190 ComObjPtr<Medium> pParent = pMedium->i_getParent();3191 Guid uMedium = pMedium->i_getId();3192 DeviceType_T uMediumType = pMedium->i_getDeviceType();3193 3072 rc = pMedium->i_deleteStorage(&task.m_pProgress, 3194 true /* aWait */, 3195 false /* aNotify */); 3073 true /* aWait */); 3196 3074 if (FAILED(rc)) 3197 3075 throw rc; 3198 3199 pMediumsForNotify.insert(pParent);3200 uIdsForNotify[uMedium] = uMediumType;3201 3076 3202 3077 // need to uninit the deleted medium … … 3206 3081 else 3207 3082 { 3208 {3209 //store ids before merging for notify3210 pMediumsForNotify.insert(it->mpTarget);3211 if (it->mfMergeForward)3212 pMediumsForNotify.insert(it->mpSource->i_getParent());3213 else3214 {3215 //children which will be reparented to target3216 for (MediaList::const_iterator iit = it->mpSource->i_getChildren().begin();3217 iit != it->mpSource->i_getChildren().end();3218 ++iit)3219 {3220 pMediumsForNotify.insert(*iit);3221 }3222 }3223 if (it->mfMergeForward)3224 {3225 for (ComObjPtr<Medium> pTmpMedium = it->mpTarget->i_getParent();3226 pTmpMedium != it->mpSource;3227 pTmpMedium = pTmpMedium->i_getParent())3228 {3229 uIdsForNotify[pTmpMedium->i_getId()] = pTmpMedium->i_getDeviceType();3230 }3231 uIdsForNotify[it->mpSource->i_getId()] = it->mpSource->i_getDeviceType();3232 }3233 else3234 {3235 for (ComObjPtr<Medium> pTmpMedium = it->mpSource->i_getParent();3236 pTmpMedium != it->mpTarget;3237 pTmpMedium = pTmpMedium->i_getParent())3238 {3239 uIdsForNotify[pTmpMedium->i_getId()] = pTmpMedium->i_getDeviceType();3240 }3241 }3242 }3243 3244 3083 bool fNeedsSave = false; 3245 3084 if (it->mfNeedsOnlineMerge) … … 3272 3111 it->mpMediumLockList, 3273 3112 &task.m_pProgress, 3274 true /* aWait */, 3275 false /* aNotify */); 3113 true /* aWait */); 3276 3114 } 3277 3115 … … 3440 3278 3441 3279 if (SUCCEEDED(mrc)) 3442 {3443 3280 mParent->i_onSnapshotDeleted(mData->mUuid, snapshotId); 3444 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();3445 it != uIdsForNotify.end();3446 ++it)3447 {3448 mParent->i_onMediumRegistered(it->first, it->second, FALSE);3449 }3450 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin();3451 it != pMediumsForNotify.end();3452 ++it)3453 {3454 if (it->isNotNull())3455 mParent->i_onMediumConfigChanged(*it);3456 }3457 }3458 3281 3459 3282 LogFlowThisFunc(("Done deleting snapshot (rc=%08X)\n", (HRESULT)mrc)); -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r76215 r76240 1963 1963 1964 1964 if (SUCCEEDED(rc)) 1965 {1966 1965 medium.queryInterfaceTo(aMedium.asOutParam()); 1967 i_onMediumRegistered(medium->i_getId(), medium->i_getDeviceType(), TRUE);1968 }1969 1966 1970 1967 return rc; … … 2017 2014 } 2018 2015 2019 bool fMediumRegistered = false;2020 2016 if (pMedium.isNull()) 2021 2017 { … … 2044 2040 rc = VBOX_E_OBJECT_NOT_FOUND; 2045 2041 } 2046 else2047 {2048 fMediumRegistered = true;2049 }2050 2042 } 2051 2043 else … … 2057 2049 2058 2050 if (SUCCEEDED(rc)) 2059 {2060 2051 pMedium.queryInterfaceTo(aMedium.asOutParam()); 2061 if (fMediumRegistered)2062 i_onMediumRegistered(pMedium->i_getId(), pMedium->i_getDeviceType() ,TRUE);2063 }2064 2052 2065 2053 return rc; … … 2264 2252 if (RT_FAILURE(vrc)) 2265 2253 fFailure = true; 2266 }2267 if (!fFailure)2268 {2269 for (MediaList::const_iterator mt = m->allHardDisks.begin();2270 mt != m->allHardDisks.end();2271 ++mt)2272 {2273 i_onMediumConfigChanged(*mt);2274 }2275 2254 } 2276 2255 return fFailure ? VERR_INVALID_PARAMETER : VINF_SUCCESS; … … 2938 2917 } 2939 2918 2940 2941 /** Event for onMediumRegistered() */2942 struct MediumRegisteredEvent : public VirtualBox::CallbackEvent2943 {2944 MediumRegisteredEvent(VirtualBox *aVB, const Guid &aMediumId,2945 const DeviceType_T aDevType, const BOOL aRegistered)2946 : CallbackEvent(aVB, VBoxEventType_OnMediumRegistered)2947 , mMediumId(aMediumId.toUtf16()), mDevType(aDevType), mRegistered(aRegistered)2948 {}2949 2950 virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)2951 {2952 return aEvDesc.init(aSource, VBoxEventType_OnMediumRegistered, mMediumId.raw(), mDevType, mRegistered);2953 }2954 2955 Bstr mMediumId;2956 DeviceType_T mDevType;2957 BOOL mRegistered;2958 };2959 2960 /**2961 * @note Doesn't lock any object.2962 */2963 void VirtualBox::i_onMediumRegistered(const Guid &aMediumId, const DeviceType_T aDevType, const BOOL aRegistered)2964 {2965 i_postEvent(new MediumRegisteredEvent(this, aMediumId, aDevType, aRegistered));2966 }2967 2968 /** Event for onMediumConfigChanged() */2969 struct MediumConfigChangedEvent : public VirtualBox::CallbackEvent2970 {2971 MediumConfigChangedEvent(VirtualBox *aVB, IMedium *aMedium)2972 : CallbackEvent(aVB, VBoxEventType_OnMediumConfigChanged)2973 , mMedium(aMedium)2974 {}2975 2976 virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)2977 {2978 return aEvDesc.init(aSource, VBoxEventType_OnMediumConfigChanged, mMedium);2979 }2980 2981 IMedium* mMedium;2982 };2983 2984 void VirtualBox::i_onMediumConfigChanged(IMedium *aMedium)2985 {2986 i_postEvent(new MediumConfigChangedEvent(this, aMedium));2987 }2988 2989 /** Event for onMediumChanged() */2990 struct MediumChangedEvent : public VirtualBox::CallbackEvent2991 {2992 MediumChangedEvent(VirtualBox *aVB, IMediumAttachment *aMediumAttachment)2993 : CallbackEvent(aVB, VBoxEventType_OnMediumChanged)2994 , mMediumAttachment(aMediumAttachment)2995 {}2996 2997 virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)2998 {2999 return aEvDesc.init(aSource, VBoxEventType_OnMediumChanged, mMediumAttachment);3000 }3001 3002 IMediumAttachment* mMediumAttachment;3003 };3004 3005 void VirtualBox::i_onMediumChanged(IMediumAttachment *aMediumAttachment)3006 {3007 i_postEvent(new MediumChangedEvent(this, aMediumAttachment));3008 }3009 3010 /** Event for onStorageDeviceChanged() */3011 struct StorageDeviceChangedEvent : public VirtualBox::CallbackEvent3012 {3013 StorageDeviceChangedEvent(VirtualBox *aVB, IMediumAttachment *aStorageDevice, BOOL fRemoved, BOOL fSilent)3014 : CallbackEvent(aVB, VBoxEventType_OnStorageDeviceChanged)3015 , mStorageDevice(aStorageDevice)3016 , mRemoved(fRemoved)3017 , mSilent(fSilent)3018 {}3019 3020 virtual HRESULT prepareEventDesc(IEventSource *aSource, VBoxEventDesc &aEvDesc)3021 {3022 return aEvDesc.init(aSource, VBoxEventType_OnStorageDeviceChanged, mStorageDevice, mRemoved, mSilent);3023 }3024 3025 IMediumAttachment* mStorageDevice;3026 BOOL mRemoved;3027 BOOL mSilent;3028 };3029 3030 void VirtualBox::i_onStorageDeviceChanged(IMediumAttachment *aStorageDevice, const BOOL fRemoved, const BOOL fSilent)3031 {3032 i_postEvent(new StorageDeviceChangedEvent(this, aStorageDevice, fRemoved, fSilent));3033 }3034 2919 3035 2920 /**
Note:
See TracChangeset
for help on using the changeset viewer.