Changeset 15334 in vbox for trunk/src/VBox/Main/DVDDriveImpl.cpp
- Timestamp:
- Dec 11, 2008 7:37:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DVDDriveImpl.cpp
r15051 r15334 275 275 if (SUCCEEDED (rc)) 276 276 { 277 mData.backup(); 278 279 unmount(); 280 281 mData->mImage = image; 282 mData->mState = DriveState_ImageMounted; 283 284 /* leave the lock before informing callbacks */ 285 alock.unlock(); 286 287 mParent->onDVDDriveChange(); 277 /* umount() will backup data */ 278 rc = unmount(); 279 if (SUCCEEDED (rc)) 280 { 281 mData->mImage = image; 282 mData->mState = DriveState_ImageMounted; 283 284 /* leave the lock before informing callbacks */ 285 alock.unlock(); 286 287 mParent->onDVDDriveChange(); 288 } 288 289 } 289 290 } … … 309 310 !mData->mHostDrive.equalsTo (aHostDVDDrive)) 310 311 { 311 mData.backup(); 312 313 unmount(); 314 315 mData->mHostDrive = aHostDVDDrive; 316 mData->mState = DriveState_HostDriveCaptured; 317 318 /* leave the lock before informing callbacks */ 319 alock.unlock(); 320 321 mParent->onDVDDriveChange(); 312 /* umount() will backup data */ 313 HRESULT rc = unmount(); 314 if (SUCCEEDED (rc)) 315 { 316 mData->mHostDrive = aHostDVDDrive; 317 mData->mState = DriveState_HostDriveCaptured; 318 319 /* leave the lock before informing callbacks */ 320 alock.unlock(); 321 322 mParent->onDVDDriveChange(); 323 } 322 324 } 323 325 … … 338 340 if (mData->mState != DriveState_NotMounted) 339 341 { 340 mData.backup(); 341 342 unmount(); 343 344 mData->mState = DriveState_NotMounted; 345 346 /* leave the lock before informing callbacks */ 347 alock.unlock(); 348 349 mParent->onDVDDriveChange(); 342 /* umount() will backup data */ 343 HRESULT rc = unmount(); 344 if (SUCCEEDED (rc)) 345 { 346 mData->mState = DriveState_NotMounted; 347 348 /* leave the lock before informing callbacks */ 349 alock.unlock(); 350 351 mParent->onDVDDriveChange(); 352 } 350 353 } 351 354 … … 385 388 386 389 /** 387 * Loads settings from the given machine node.388 * May be called once right afterthis object creation.389 * 390 * @param aMachineNode<Machine> node.391 * 392 * 390 * Loads settings from the given machine node. May be called once right after 391 * this object creation. 392 * 393 * @param aMachineNode <Machine> node. 394 * 395 * @note Locks this object for writing. 393 396 */ 394 397 HRESULT DVDDrive::loadSettings (const settings::Key &aMachineNode) … … 469 472 470 473 /** 471 * 472 * 473 * @param aMachineNode<Machine> node.474 * 475 * 474 * Saves settings to the given machine node. 475 * 476 * @param aMachineNode <Machine> node. 477 * 478 * @note Locks this object for reading. 476 479 */ 477 480 HRESULT DVDDrive::saveSettings (settings::Key &aMachineNode) … … 530 533 531 534 /** 532 * 535 * @note Locks this object for writing. 533 536 */ 534 537 bool DVDDrive::rollback() … … 567 570 568 571 /** 569 * @note Locks this object for writing, together with the peer object (also570 * forwriting) if there is one.572 * @note Locks this object for writing, together with the peer object (also for 573 * writing) if there is one. 571 574 */ 572 575 void DVDDrive::commit() … … 605 608 606 609 /** 607 * 608 * represented by @a aThat (locked for reading).610 * @note Locks this object for writing, together with the peer object 611 * represented by @a aThat (locked for reading). 609 612 */ 610 613 void DVDDrive::copyFrom (DVDDrive *aThat) … … 628 631 } 629 632 630 // private methods 631 //////////////////////////////////////////////////////////////////////////////// 632 633 /** 634 * Helper to unmount a drive. 635 * 636 * @return COM status code 637 * 633 /** 634 * Helper to unmount a drive. 635 * 636 * @note Must be called from under this object's write lock. 638 637 */ 639 638 HRESULT DVDDrive::unmount() 640 639 { 641 640 AssertReturn (isWriteLockOnCurrentThread(), E_FAIL); 641 642 mData.backup(); 642 643 643 644 if (mData->mImage) … … 646 647 mData->mHostDrive.setNull(); 647 648 648 return S_OK; 649 } 649 mData->mState = DriveState_NotMounted; 650 651 return S_OK; 652 } 653 654 // private methods 655 //////////////////////////////////////////////////////////////////////////////// 656 650 657 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.