Changeset 15991 in vbox
- Timestamp:
- Jan 16, 2009 2:02:20 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r15945 r15991 2509 2509 HRESULT Console::onDVDDriveChange() 2510 2510 { 2511 LogFlowThisFunc (("\n"));2511 LogFlowThisFuncEnter(); 2512 2512 2513 2513 AutoCaller autoCaller (this); … … 2578 2578 2579 2579 AssertComRC (rc); 2580 if (FAILED (rc))2581 {2582 LogFlowThisFunc (("Returns %#x\n", rc));2583 return rc;2584 }2585 2586 rc = doDriveChange ("piix3ide", 0, 2, eState, &meDVDState,2587 Utf8Str (Path).raw(), fPassthrough);2588 2589 /* notify console callbacks on success */2590 2580 if (SUCCEEDED (rc)) 2591 2581 { 2592 CallbackList::iterator it = mCallbacks.begin(); 2593 while (it != mCallbacks.end()) 2594 (*it++)->OnDVDDriveChange(); 2595 } 2596 2582 rc = doDriveChange ("piix3ide", 0, 2, eState, &meDVDState, 2583 Utf8Str (Path).raw(), fPassthrough); 2584 2585 /* notify console callbacks on success */ 2586 if (SUCCEEDED (rc)) 2587 { 2588 CallbackList::iterator it = mCallbacks.begin(); 2589 while (it != mCallbacks.end()) 2590 (*it++)->OnDVDDriveChange(); 2591 } 2592 } 2593 2594 LogFlowThisFunc (("Returns %Rhrc (%#x)\n", rc, rc)); 2595 LogFlowThisFuncLeave(); 2597 2596 return rc; 2598 2597 } … … 2606 2605 HRESULT Console::onFloppyDriveChange() 2607 2606 { 2608 LogFlowThisFunc (("\n"));2607 LogFlowThisFuncEnter(); 2609 2608 2610 2609 AutoCaller autoCaller (this); … … 2680 2679 2681 2680 AssertComRC (rc); 2682 if (FAILED (rc))2683 {2684 LogFlowThisFunc (("Returns %#x\n", rc));2685 return rc;2686 }2687 2688 rc = doDriveChange ("i82078", 0, 0, eState, &meFloppyState,2689 Utf8Str (Path).raw(), false);2690 2691 /* notify console callbacks on success */2692 2681 if (SUCCEEDED (rc)) 2693 2682 { 2694 CallbackList::iterator it = mCallbacks.begin(); 2695 while (it != mCallbacks.end()) 2696 (*it++)->OnFloppyDriveChange(); 2697 } 2698 2683 rc = doDriveChange ("i82078", 0, 0, eState, &meFloppyState, 2684 Utf8Str (Path).raw(), false); 2685 2686 /* notify console callbacks on success */ 2687 if (SUCCEEDED (rc)) 2688 { 2689 CallbackList::iterator it = mCallbacks.begin(); 2690 while (it != mCallbacks.end()) 2691 (*it++)->OnFloppyDriveChange(); 2692 } 2693 } 2694 2695 LogFlowThisFunc (("Returns %Rhrc (%#x)\n", rc, rc)); 2696 LogFlowThisFuncLeave(); 2699 2697 return rc; 2700 2698 } -
trunk/src/VBox/Main/DVDDriveImpl.cpp
r15661 r15991 29 29 #include "VirtualBoxImpl.h" 30 30 31 #include "Global.h" 32 31 33 #include "Logging.h" 32 34 … … 70 72 /* mPeer is left null */ 71 73 72 m Data.allocate();74 m.allocate(); 73 75 74 76 /* Confirm a successful initialization */ … … 105 107 106 108 AutoReadLock thatLock (aThat); 107 m Data.share (aThat->mData);109 m.share (aThat->m); 108 110 109 111 /* Confirm a successful initialization */ … … 137 139 138 140 AutoReadLock thatLock (aThat); 139 m Data.attachCopy (aThat->mData);141 m.attachCopy (aThat->m); 140 142 141 143 /* at present, this must be a snapshot machine */ 142 144 Assert (!aParent->snapshotId().isEmpty()); 143 145 144 if (m Data->mState == DriveState_ImageMounted)146 if (m->state == DriveState_ImageMounted) 145 147 { 146 148 /* associate the DVD image media with the snapshot */ 147 HRESULT rc = m Data->mImage->attachTo (aParent->id(),148 149 HRESULT rc = m->image->attachTo (aParent->id(), 150 aParent->snapshotId()); 149 151 AssertComRC (rc); 150 152 } … … 171 173 if ((mParent->type() == Machine::IsMachine || 172 174 mParent->type() == Machine::IsSnapshotMachine) && 173 m Data->mState == DriveState_ImageMounted)175 m->state == DriveState_ImageMounted) 174 176 { 175 177 /* Deassociate the DVD image (only when mParent is a real Machine or a … … 178 180 * re-initialization of the VM after successfully re-checking the 179 181 * accessibility state. */ 180 HRESULT rc = m Data->mImage->detachFrom (mParent->id(),181 182 HRESULT rc = m->image->detachFrom (mParent->id(), 183 mParent->snapshotId()); 182 184 AssertComRC (rc); 183 185 } 184 186 185 m Data.free();187 m.free(); 186 188 187 189 unconst (mPeer).setNull(); … … 201 203 AutoReadLock alock (this); 202 204 203 *aState = m Data->mState;205 *aState = m->state; 204 206 205 207 return S_OK; … … 215 217 AutoReadLock alock (this); 216 218 217 *aPassthrough = m Data->mPassthrough;219 *aPassthrough = m->passthrough; 218 220 219 221 return S_OK; … … 231 233 AutoWriteLock alock (this); 232 234 233 if (m Data->mPassthrough != aPassthrough)234 { 235 m Data.backup();236 m Data->mPassthrough = aPassthrough;235 if (m->passthrough != aPassthrough) 236 { 237 m.backup(); 238 m->passthrough = aPassthrough; 237 239 } 238 240 … … 268 270 if (SUCCEEDED (rc)) 269 271 { 270 if (m Data->mState != DriveState_ImageMounted ||271 !m Data->mImage.equalsTo (image))272 if (m->state != DriveState_ImageMounted || 273 !m->image.equalsTo (image)) 272 274 { 273 275 rc = image->attachTo (mParent->id(), mParent->snapshotId()); … … 276 278 /* umount() will backup data */ 277 279 rc = unmount(); 280 278 281 if (SUCCEEDED (rc)) 279 282 { 280 mData->mImage = image; 281 mData->mState = DriveState_ImageMounted; 283 /* lock the image for reading if the VM is online. It will 284 * be unlocked either when unmounted from this drive or by 285 * SessionMachine::setMachineState() when the VM is 286 * terminated */ 287 if (Global::IsOnline (adep.machineState())) 288 rc = image->LockRead (NULL); 289 } 290 291 if (SUCCEEDED (rc)) 292 { 293 m->image = image; 294 m->state = DriveState_ImageMounted; 282 295 283 296 /* leave the lock before informing callbacks */ … … 306 319 AutoWriteLock alock (this); 307 320 308 if (m Data->mState != DriveState_HostDriveCaptured ||309 !m Data->mHostDrive.equalsTo (aHostDVDDrive))321 if (m->state != DriveState_HostDriveCaptured || 322 !m->hostDrive.equalsTo (aHostDVDDrive)) 310 323 { 311 324 /* umount() will backup data */ … … 313 326 if (SUCCEEDED (rc)) 314 327 { 315 m Data->mHostDrive = aHostDVDDrive;316 m Data->mState = DriveState_HostDriveCaptured;328 m->hostDrive = aHostDVDDrive; 329 m->state = DriveState_HostDriveCaptured; 317 330 318 331 /* leave the lock before informing callbacks */ … … 337 350 AutoWriteLock alock (this); 338 351 339 if (m Data->mState != DriveState_NotMounted)352 if (m->state != DriveState_NotMounted) 340 353 { 341 354 /* umount() will backup data */ … … 343 356 if (SUCCEEDED (rc)) 344 357 { 345 m Data->mState = DriveState_NotMounted;358 m->state = DriveState_NotMounted; 346 359 347 360 /* leave the lock before informing callbacks */ … … 364 377 AutoReadLock alock (this); 365 378 366 m Data->mImage.queryInterfaceTo (aDVDImage);379 m->image.queryInterfaceTo (aDVDImage); 367 380 368 381 return S_OK; … … 378 391 AutoReadLock alock (this); 379 392 380 m Data->mHostDrive.queryInterfaceTo (aHostDrive);393 m->hostDrive.queryInterfaceTo (aHostDrive); 381 394 382 395 return S_OK; … … 422 435 423 436 /* optional, defaults to false */ 424 m Data->mPassthrough = dvdDriveNode.value <bool> ("passthrough");437 m->passthrough = dvdDriveNode.value <bool> ("passthrough"); 425 438 426 439 Key typeNode; … … 490 503 Key node = aMachineNode.createKey ("DVDDrive"); 491 504 492 node.setValue <bool> ("passthrough", !!m Data->mPassthrough);493 494 switch (m Data->mState)505 node.setValue <bool> ("passthrough", !!m->passthrough); 506 507 switch (m->state) 495 508 { 496 509 case DriveState_ImageMounted: 497 510 { 498 Assert (!m Data->mImage.isNull());511 Assert (!m->image.isNull()); 499 512 500 513 Guid id; 501 HRESULT rc = m Data->mImage->COMGETTER(Id) (id.asOutParam());514 HRESULT rc = m->image->COMGETTER(Id) (id.asOutParam()); 502 515 AssertComRC (rc); 503 516 Assert (!id.isEmpty()); … … 509 522 case DriveState_HostDriveCaptured: 510 523 { 511 Assert (!m Data->mHostDrive.isNull());524 Assert (!m->hostDrive.isNull()); 512 525 513 526 Bstr name; 514 HRESULT rc = m Data->mHostDrive->COMGETTER(Name) (name.asOutParam());527 HRESULT rc = m->hostDrive->COMGETTER(Name) (name.asOutParam()); 515 528 AssertComRC (rc); 516 529 Assert (!name.isEmpty()); … … 524 537 break; 525 538 default: 526 ComAssertMsgFailedRet (("Invalid drive state: %d", m Data->mState),539 ComAssertMsgFailedRet (("Invalid drive state: %d", m->state), 527 540 E_FAIL); 528 541 } … … 540 553 AssertComRCReturn (autoCaller.rc(), false); 541 554 555 /* we need adep for the state check */ 556 Machine::AutoAnyStateDependency adep (mParent); 557 AssertComRCReturn (adep.rc(), false); 558 542 559 AutoWriteLock alock (this); 543 560 544 561 bool changed = false; 545 562 546 if (m Data.isBackedUp())563 if (m.isBackedUp()) 547 564 { 548 565 /* we need to check all data to see whether anything will be changed 549 566 * after rollback */ 550 changed = m Data.hasActualChanges();567 changed = m.hasActualChanges(); 551 568 552 569 if (changed) 553 570 { 554 Data *oldData = m Data.backedUpData();555 556 if (!m Data->mImage.isNull() &&557 !oldData-> mImage.equalsTo (mData->mImage))571 Data *oldData = m.backedUpData(); 572 573 if (!m->image.isNull() && 574 !oldData->image.equalsTo (m->image)) 558 575 { 559 576 /* detach the current image that will go away after rollback */ 560 mData->mImage->detachFrom (mParent->id(), mParent->snapshotId()); 577 m->image->detachFrom (mParent->id(), mParent->snapshotId()); 578 579 /* unlock the image for reading if the VM is online */ 580 if (Global::IsOnline (adep.machineState())) 581 { 582 HRESULT rc = m->image->UnlockRead (NULL); 583 AssertComRC (rc); 584 } 561 585 } 562 586 } 563 587 564 m Data.rollback();588 m.rollback(); 565 589 } 566 590 … … 582 606 AssertComRCReturnVoid (peerCaller.rc()); 583 607 608 /* we need adep for the state check */ 609 Machine::AutoAnyStateDependency adep (mParent); 610 AssertComRCReturnVoid (adep.rc()); 611 584 612 /* lock both for writing since we modify both (mPeer is "master" so locked 585 613 * first) */ 586 614 AutoMultiWriteLock2 alock (mPeer, this); 587 615 588 if (m Data.isBackedUp())589 { 590 Data *oldData = m Data.backedUpData();591 592 if (!oldData-> mImage.isNull() &&593 !oldData-> mImage.equalsTo (mData->mImage))616 if (m.isBackedUp()) 617 { 618 Data *oldData = m.backedUpData(); 619 620 if (!oldData->image.isNull() && 621 !oldData->image.equalsTo (m->image)) 594 622 { 595 623 /* detach the old image that will go away after commit */ 596 oldData->mImage->detachFrom (mParent->id(), mParent->snapshotId()); 597 } 598 599 mData.commit(); 624 oldData->image->detachFrom (mParent->id(), mParent->snapshotId()); 625 626 /* unlock the image for reading if the VM is online */ 627 if (Global::IsOnline (adep.machineState())) 628 { 629 HRESULT rc = oldData->image->UnlockRead (NULL); 630 AssertComRC (rc); 631 } 632 } 633 634 m.commit(); 600 635 if (mPeer) 601 636 { 602 637 /* attach new data to the peer and reshare it */ 603 mPeer->m Data.attach (mData);638 mPeer->m.attach (m); 604 639 } 605 640 } … … 627 662 628 663 /* this will back up current data */ 629 m Data.assignCopy (aThat->mData);664 m.assignCopy (aThat->m); 630 665 } 631 666 … … 639 674 AssertReturn (isWriteLockOnCurrentThread(), E_FAIL); 640 675 641 m Data.backup();642 643 if (m Data->mImage)644 m Data->mImage.setNull();645 if (m Data->mHostDrive)646 m Data->mHostDrive.setNull();647 648 m Data->mState = DriveState_NotMounted;676 m.backup(); 677 678 if (m->image) 679 m->image.setNull(); 680 if (m->hostDrive) 681 m->hostDrive.setNull(); 682 683 m->state = DriveState_NotMounted; 649 684 650 685 return S_OK; -
trunk/src/VBox/Main/FloppyDriveImpl.cpp
r15714 r15991 29 29 #include "VirtualBoxImpl.h" 30 30 31 #include "Global.h" 32 31 33 #include "Logging.h" 32 34 … … 70 72 /* mPeer is left null */ 71 73 72 m Data.allocate();74 m.allocate(); 73 75 74 76 /* Confirm a successful initialization */ … … 105 107 106 108 AutoReadLock thatLock (aThat); 107 m Data.share (aThat->mData);109 m.share (aThat->m); 108 110 109 111 /* Confirm a successful initialization */ … … 137 139 138 140 AutoReadLock thatLock (aThat); 139 m Data.attachCopy (aThat->mData);141 m.attachCopy (aThat->m); 140 142 141 143 /* at present, this must be a snapshot machine */ 142 144 Assert (!aParent->snapshotId().isEmpty()); 143 145 144 if (m Data->mState == DriveState_ImageMounted)146 if (m->state == DriveState_ImageMounted) 145 147 { 146 148 /* associate the DVD image media with the snapshot */ 147 HRESULT rc = m Data->mImage->attachTo (aParent->id(),148 149 HRESULT rc = m->image->attachTo (aParent->id(), 150 aParent->snapshotId()); 149 151 AssertComRC (rc); 150 152 } … … 171 173 if ((mParent->type() == Machine::IsMachine || 172 174 mParent->type() == Machine::IsSnapshotMachine) && 173 m Data->mState == DriveState_ImageMounted)175 m->state == DriveState_ImageMounted) 174 176 { 175 177 /* Deassociate the DVD image (only when mParent is a real Machine or a … … 178 180 * re-initialization of the VM after successfully re-checking the 179 181 * accessibility state. */ 180 HRESULT rc = m Data->mImage->detachFrom (mParent->id(),181 182 HRESULT rc = m->image->detachFrom (mParent->id(), 183 mParent->snapshotId()); 182 184 AssertComRC (rc); 183 185 } 184 186 185 m Data.free();187 m.free(); 186 188 187 189 unconst (mPeer).setNull(); … … 201 203 AutoReadLock alock (this); 202 204 203 *aEnabled = m Data->mEnabled;205 *aEnabled = m->enabled; 204 206 205 207 return S_OK; … … 219 221 AutoWriteLock alock (this); 220 222 221 if (m Data->mEnabled != aEnabled)222 { 223 m Data.backup();224 m Data->mEnabled = aEnabled;223 if (m->enabled != aEnabled) 224 { 225 m.backup(); 226 m->enabled = aEnabled; 225 227 226 228 /* leave the lock before informing callbacks */ … … 242 244 AutoReadLock alock (this); 243 245 244 *aState = m Data->mState;246 *aState = m->state; 245 247 246 248 return S_OK; … … 275 277 if (SUCCEEDED (rc)) 276 278 { 277 if (m Data->mState != DriveState_ImageMounted ||278 !m Data->mImage.equalsTo (image))279 if (m->state != DriveState_ImageMounted || 280 !m->image.equalsTo (image)) 279 281 { 280 282 rc = image->attachTo (mParent->id(), mParent->snapshotId()); … … 283 285 /* umount() will backup data */ 284 286 rc = unmount(); 287 285 288 if (SUCCEEDED (rc)) 286 289 { 287 mData->mImage = image; 288 mData->mState = DriveState_ImageMounted; 290 /* lock the image for reading if the VM is online. It will 291 * be unlocked either when unmounted from this drive or by 292 * SessionMachine::setMachineState() when the VM is 293 * terminated */ 294 if (Global::IsOnline (adep.machineState())) 295 rc = image->LockRead (NULL); 296 } 297 298 if (SUCCEEDED (rc)) 299 { 300 m->image = image; 301 m->state = DriveState_ImageMounted; 289 302 290 303 /* leave the lock before informing callbacks */ … … 313 326 AutoWriteLock alock (this); 314 327 315 if (m Data->mState != DriveState_HostDriveCaptured ||316 !m Data->mHostDrive.equalsTo (aHostFloppyDrive))328 if (m->state != DriveState_HostDriveCaptured || 329 !m->hostDrive.equalsTo (aHostFloppyDrive)) 317 330 { 318 331 /* umount() will backup data */ … … 320 333 if (SUCCEEDED (rc)) 321 334 { 322 m Data->mHostDrive = aHostFloppyDrive;323 m Data->mState = DriveState_HostDriveCaptured;335 m->hostDrive = aHostFloppyDrive; 336 m->state = DriveState_HostDriveCaptured; 324 337 325 338 /* leave the lock before informing callbacks */ … … 344 357 AutoWriteLock alock (this); 345 358 346 if (m Data->mState != DriveState_NotMounted)359 if (m->state != DriveState_NotMounted) 347 360 { 348 361 /* umount() will backup data */ … … 350 363 if (SUCCEEDED (rc)) 351 364 { 352 m Data->mState = DriveState_NotMounted;365 m->state = DriveState_NotMounted; 353 366 354 367 /* leave the lock before informing callbacks */ … … 371 384 AutoReadLock alock (this); 372 385 373 m Data->mImage.queryInterfaceTo (aFloppyImage);386 m->image.queryInterfaceTo (aFloppyImage); 374 387 375 388 return S_OK; … … 385 398 AutoReadLock alock (this); 386 399 387 m Data->mHostDrive.queryInterfaceTo (aHostDrive);400 m->hostDrive.queryInterfaceTo (aHostDrive); 388 401 389 402 return S_OK; … … 429 442 430 443 /* optional, defaults to true */ 431 m Data->mEnabled = floppyDriveNode.value <bool> ("enabled");444 m->enabled = floppyDriveNode.value <bool> ("enabled"); 432 445 433 446 Key typeNode; … … 497 510 Key node = aMachineNode.createKey ("FloppyDrive"); 498 511 499 node.setValue <bool> ("enabled", !!m Data->mEnabled);500 501 switch (m Data->mState)512 node.setValue <bool> ("enabled", !!m->enabled); 513 514 switch (m->state) 502 515 { 503 516 case DriveState_ImageMounted: 504 517 { 505 Assert (!m Data->mImage.isNull());518 Assert (!m->image.isNull()); 506 519 507 520 Guid id; 508 HRESULT rc = m Data->mImage->COMGETTER(Id) (id.asOutParam());521 HRESULT rc = m->image->COMGETTER(Id) (id.asOutParam()); 509 522 AssertComRC (rc); 510 523 Assert (!id.isEmpty()); … … 516 529 case DriveState_HostDriveCaptured: 517 530 { 518 Assert (!m Data->mHostDrive.isNull());531 Assert (!m->hostDrive.isNull()); 519 532 520 533 Bstr name; 521 HRESULT rc = m Data->mHostDrive->COMGETTER(Name) (name.asOutParam());534 HRESULT rc = m->hostDrive->COMGETTER(Name) (name.asOutParam()); 522 535 AssertComRC (rc); 523 536 Assert (!name.isEmpty()); … … 531 544 break; 532 545 default: 533 ComAssertMsgFailedRet (("Invalid drive state: %d", m Data->mState),546 ComAssertMsgFailedRet (("Invalid drive state: %d", m->state), 534 547 E_FAIL); 535 548 } … … 547 560 AssertComRCReturn (autoCaller.rc(), false); 548 561 562 /* we need adep for the state check */ 563 Machine::AutoAnyStateDependency adep (mParent); 564 AssertComRCReturn (adep.rc(), false); 565 549 566 AutoWriteLock alock (this); 550 567 551 568 bool changed = false; 552 569 553 if (m Data.isBackedUp())570 if (m.isBackedUp()) 554 571 { 555 572 /* we need to check all data to see whether anything will be changed 556 573 * after rollback */ 557 changed = m Data.hasActualChanges();574 changed = m.hasActualChanges(); 558 575 559 576 if (changed) 560 577 { 561 Data *oldData = m Data.backedUpData();562 563 if (!m Data->mImage.isNull() &&564 !oldData-> mImage.equalsTo (mData->mImage))578 Data *oldData = m.backedUpData(); 579 580 if (!m->image.isNull() && 581 !oldData->image.equalsTo (m->image)) 565 582 { 566 583 /* detach the current image that will go away after rollback */ 567 mData->mImage->detachFrom (mParent->id(), mParent->snapshotId()); 584 m->image->detachFrom (mParent->id(), mParent->snapshotId()); 585 586 /* unlock the image for reading if the VM is online */ 587 if (Global::IsOnline (adep.machineState())) 588 { 589 HRESULT rc = m->image->UnlockRead (NULL); 590 AssertComRC (rc); 591 } 568 592 } 569 593 } 570 594 571 m Data.rollback();595 m.rollback(); 572 596 } 573 597 … … 589 613 AssertComRCReturnVoid (peerCaller.rc()); 590 614 615 /* we need adep for the state check */ 616 Machine::AutoAnyStateDependency adep (mParent); 617 AssertComRCReturnVoid (adep.rc()); 618 591 619 /* lock both for writing since we modify both (mPeer is "master" so locked 592 620 * first) */ 593 621 AutoMultiWriteLock2 alock (mPeer, this); 594 622 595 if (m Data.isBackedUp())596 { 597 Data *oldData = m Data.backedUpData();598 599 if (!oldData-> mImage.isNull() &&600 !oldData-> mImage.equalsTo (mData->mImage))623 if (m.isBackedUp()) 624 { 625 Data *oldData = m.backedUpData(); 626 627 if (!oldData->image.isNull() && 628 !oldData->image.equalsTo (m->image)) 601 629 { 602 630 /* detach the old image that will go away after commit */ 603 oldData->mImage->detachFrom (mParent->id(), mParent->snapshotId()); 604 } 605 606 mData.commit(); 631 oldData->image->detachFrom (mParent->id(), mParent->snapshotId()); 632 633 /* unlock the image for reading if the VM is online */ 634 if (Global::IsOnline (adep.machineState())) 635 { 636 HRESULT rc = oldData->image->UnlockRead (NULL); 637 AssertComRC (rc); 638 } 639 } 640 641 m.commit(); 607 642 if (mPeer) 608 643 { 609 644 /* attach new data to the peer and reshare it */ 610 mPeer->m Data.attach (mData);645 mPeer->m.attach (m); 611 646 } 612 647 } … … 632 667 633 668 /* this will back up current data */ 634 m Data.assignCopy (aThat->mData);669 m.assignCopy (aThat->m); 635 670 } 636 671 … … 644 679 AssertReturn (isWriteLockOnCurrentThread(), E_FAIL); 645 680 646 m Data.backup();647 648 if (m Data->mImage)649 m Data->mImage.setNull();650 if (m Data->mHostDrive)651 m Data->mHostDrive.setNull();652 653 m Data->mState = DriveState_NotMounted;681 m.backup(); 682 683 if (m->image) 684 m->image.setNull(); 685 if (m->hostDrive) 686 m->hostDrive.setNull(); 687 688 m->state = DriveState_NotMounted; 654 689 655 690 return S_OK; -
trunk/src/VBox/Main/MachineImpl.cpp
r15945 r15991 10428 10428 { 10429 10429 AutoReadLock driveLock (mDVDDrive); 10430 if (mDVDDrive->data()-> mState == DriveState_ImageMounted)10430 if (mDVDDrive->data()->state == DriveState_ImageMounted) 10431 10431 { 10432 rc = mDVDDrive->data()-> mImage->UnlockRead (NULL);10432 rc = mDVDDrive->data()->image->UnlockRead (NULL); 10433 10433 AssertComRC (rc); 10434 10434 } … … 10436 10436 { 10437 10437 AutoReadLock driveLock (mFloppyDrive); 10438 if (mFloppyDrive->data()-> mState == DriveState_ImageMounted)10438 if (mFloppyDrive->data()->state == DriveState_ImageMounted) 10439 10439 { 10440 rc = mFloppyDrive->data()-> mImage->UnlockRead (NULL);10440 rc = mFloppyDrive->data()->image->UnlockRead (NULL); 10441 10441 AssertComRC (rc); 10442 10442 } -
trunk/src/VBox/Main/include/DVDDriveImpl.h
r15334 r15991 43 43 Data() 44 44 { 45 mState = DriveState_NotMounted;46 mPassthrough = false;45 state = DriveState_NotMounted; 46 passthrough = false; 47 47 } 48 48 … … 50 50 { 51 51 return this == &that || 52 ( mState == that.mState &&53 mImage.equalsTo (that.mImage) &&54 mHostDrive.equalsTo (that.mHostDrive));52 (state == that.state && 53 image.equalsTo (that.image) && 54 hostDrive.equalsTo (that.hostDrive)); 55 55 } 56 56 57 ComObjPtr <DVDImage2> mImage;58 ComPtr <IHostDVDDrive> mHostDrive;59 DriveState_T mState;60 BOOL mPassthrough;57 ComObjPtr <DVDImage2> image; 58 ComPtr <IHostDVDDrive> hostDrive; 59 DriveState_T state; 60 BOOL passthrough; 61 61 }; 62 62 … … 102 102 HRESULT saveSettings (settings::Key &aMachineNode); 103 103 104 bool isModified() { AutoWriteLock alock (this); return m Data.isBackedUp(); }105 bool isReallyModified() { AutoWriteLock alock (this); return m Data.hasActualChanges(); }104 bool isModified() { AutoWriteLock alock (this); return m.isBackedUp(); } 105 bool isReallyModified() { AutoWriteLock alock (this); return m.hasActualChanges(); } 106 106 bool rollback(); 107 107 void commit(); … … 113 113 // (ensure there is a caller and a read lock before calling them!) 114 114 115 Backupable <Data> &data() { return m Data; }115 Backupable <Data> &data() { return m; } 116 116 117 117 // for VirtualBoxSupportErrorInfoImpl … … 123 123 const ComObjPtr <DVDDrive> mPeer; 124 124 125 Backupable <Data> m Data;125 Backupable <Data> m; 126 126 }; 127 127 -
trunk/src/VBox/Main/include/FloppyDriveImpl.h
r15334 r15991 43 43 Data() 44 44 { 45 mEnabled= true;46 mState = DriveState_NotMounted;45 enabled = true; 46 state = DriveState_NotMounted; 47 47 } 48 48 … … 50 50 { 51 51 return this == &that || 52 ( mState == that.mState &&53 mImage.equalsTo (that.mImage) &&54 mHostDrive.equalsTo (that.mHostDrive));52 (state == that.state && 53 image.equalsTo (that.image) && 54 hostDrive.equalsTo (that.hostDrive)); 55 55 } 56 56 57 BOOL mEnabled;58 ComObjPtr <FloppyImage2> mImage;59 ComPtr <IHostFloppyDrive> mHostDrive;60 DriveState_T mState;57 BOOL enabled; 58 ComObjPtr <FloppyImage2> image; 59 ComPtr <IHostFloppyDrive> hostDrive; 60 DriveState_T state; 61 61 }; 62 62 … … 102 102 HRESULT saveSettings (settings::Key &aMachineNode); 103 103 104 bool isModified() { AutoWriteLock alock (this); return m Data.isBackedUp(); }105 bool isReallyModified() { AutoWriteLock alock (this); return m Data.hasActualChanges(); }104 bool isModified() { AutoWriteLock alock (this); return m.isBackedUp(); } 105 bool isReallyModified() { AutoWriteLock alock (this); return m.hasActualChanges(); } 106 106 bool rollback(); 107 107 void commit(); … … 113 113 // (ensure there is a caller and a read lock before calling them!) 114 114 115 Backupable <Data> &data() { return m Data; }115 Backupable <Data> &data() { return m; } 116 116 117 117 // for VirtualBoxSupportErrorInfoImpl … … 123 123 const ComObjPtr <FloppyDrive> mPeer; 124 124 125 Backupable <Data> m Data;125 Backupable <Data> m; 126 126 }; 127 127
Note:
See TracChangeset
for help on using the changeset viewer.