Changeset 61377 in vbox
- Timestamp:
- Jun 1, 2016 2:20:24 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 107685
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r56820 r61377 36 36 { 37 37 BackupableMediumAttachmentData() 38 : lPort(0), 39 lDevice(0), 40 type(DeviceType_Null), 41 fPassthrough(false), 42 fTempEject(false), 43 fNonRotational(false), 44 fDiscard(false), 45 fImplicit(false), 46 fHotPluggable(false) 38 : fImplicit(false) 47 39 { } 48 40 49 ComObjPtr<Medium> pMedium;41 ComObjPtr<Medium> pMedium; 50 42 /* Since MediumAttachment is not a first class citizen when it 51 43 * comes to managing settings, having a reference to the storage … … 53 45 * to the old, uninitialized instance. Changing this requires 54 46 * substantial changes to MediumImpl.cpp. */ 55 const Utf8Str strControllerName;56 47 /* Same counts for the assigned bandwidth group */ 57 Utf8Str strBandwidthGroup; 58 const LONG lPort; 59 const LONG lDevice; 60 const DeviceType_T type; 61 bool fPassthrough; 62 bool fTempEject; 63 bool fNonRotational; 64 bool fDiscard; 65 bool fImplicit; 66 bool fHotPluggable; 48 bool fImplicit; 49 const Utf8Str strControllerName; 50 settings::AttachedDevice mData; 67 51 }; 68 52 … … 75 59 76 60 /** Reference to Machine object, for checking mutable state. */ 77 Machine * const pMachine;61 Machine * const pMachine; 78 62 /* later: const ComObjPtr<MediumAttachment> mPeer; */ 79 80 bool fIsEjected; 81 63 bool fIsEjected; 82 64 Backupable<BackupableMediumAttachmentData> bd; 83 65 }; … … 146 128 m->bd.allocate(); 147 129 m->bd->pMedium = aMedium; 148 unconst(m->bd->strBandwidthGroup)= strBandwidthGroup;130 m->bd->mData.strBwGroup = strBandwidthGroup; 149 131 unconst(m->bd->strControllerName) = aControllerName; 150 unconst(m->bd->lPort)= aPort;151 unconst(m->bd->lDevice)= aDevice;152 unconst(m->bd->type)= aType;153 154 m->bd-> fPassthrough = aPassthrough;155 m->bd-> fTempEject = aTempEject;156 m->bd-> fNonRotational = aNonRotational;157 m->bd-> fDiscard = aDiscard;132 m->bd->mData.lPort = aPort; 133 m->bd->mData.lDevice = aDevice; 134 m->bd->mData.deviceType = aType; 135 136 m->bd->mData.fPassThrough = aPassthrough; 137 m->bd->mData.fTempEject = aTempEject; 138 m->bd->mData.fNonRotational = aNonRotational; 139 m->bd->mData.fDiscard = aDiscard; 158 140 m->bd->fImplicit = aImplicit; 159 m->bd-> fHotPluggable = aHotPluggable;141 m->bd->mData.fHotPluggable = aHotPluggable; 160 142 161 143 /* Confirm a successful initialization when it's the case */ … … 262 244 263 245 /* m->bd->port is constant during life time, no need to lock */ 264 *aPort = m->bd-> lPort;246 *aPort = m->bd->mData.lPort; 265 247 266 248 LogFlowThisFuncLeave(); … … 273 255 274 256 /* m->bd->device is constant during life time, no need to lock */ 275 *aDevice = m->bd-> lDevice;257 *aDevice = m->bd->mData.lDevice; 276 258 277 259 LogFlowThisFuncLeave(); … … 284 266 285 267 /* m->bd->type is constant during life time, no need to lock */ 286 *aType = m->bd-> type;268 *aType = m->bd->mData.deviceType; 287 269 288 270 LogFlowThisFuncLeave(); … … 297 279 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 298 280 299 *aPassthrough = m->bd-> fPassthrough;281 *aPassthrough = m->bd->mData.fPassThrough; 300 282 301 283 LogFlowThisFuncLeave(); … … 310 292 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 311 293 312 *aTemporaryEject = m->bd-> fTempEject;294 *aTemporaryEject = m->bd->mData.fTempEject; 313 295 314 296 LogFlowThisFuncLeave(); … … 336 318 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 337 319 338 *aNonRotational = m->bd-> fNonRotational;320 *aNonRotational = m->bd->mData.fNonRotational; 339 321 340 322 LogFlowThisFuncLeave(); … … 348 330 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 349 331 350 *aDiscard = m->bd-> fDiscard;332 *aDiscard = m->bd->mData.fDiscard; 351 333 352 334 LogFlowThisFuncLeave(); … … 362 344 363 345 HRESULT hrc = S_OK; 364 if (m->bd-> strBandwidthGroup.isNotEmpty())346 if (m->bd->mData.strBwGroup.isNotEmpty()) 365 347 { 366 348 ComObjPtr<BandwidthGroup> pBwGroup; 367 hrc = m->pMachine->i_getBandwidthGroup(m->bd-> strBandwidthGroup, pBwGroup, true /* fSetError */);349 hrc = m->pMachine->i_getBandwidthGroup(m->bd->mData.strBwGroup, pBwGroup, true /* fSetError */); 368 350 369 351 Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the … … 384 366 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 385 367 386 *aHotPluggable = m->bd-> fHotPluggable;368 *aHotPluggable = m->bd->mData.fHotPluggable; 387 369 388 370 LogFlowThisFuncLeave(); … … 449 431 LONG MediumAttachment::i_getPort() const 450 432 { 451 return m->bd-> lPort;433 return m->bd->mData.lPort; 452 434 } 453 435 454 436 LONG MediumAttachment::i_getDevice() const 455 437 { 456 return m->bd-> lDevice;438 return m->bd->mData.lDevice; 457 439 } 458 440 459 441 DeviceType_T MediumAttachment::i_getType() const 460 442 { 461 return m->bd-> type;443 return m->bd->mData.deviceType; 462 444 } 463 445 … … 465 447 { 466 448 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 467 return m->bd-> fPassthrough;449 return m->bd->mData.fPassThrough; 468 450 } 469 451 … … 471 453 { 472 454 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 473 return m->bd-> fTempEject;455 return m->bd->mData.fTempEject; 474 456 } 475 457 … … 477 459 { 478 460 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 479 return m->bd-> fNonRotational;461 return m->bd->mData.fNonRotational; 480 462 } 481 463 … … 483 465 { 484 466 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 485 return m->bd-> fDiscard;467 return m->bd->mData.fDiscard; 486 468 } 487 469 … … 489 471 { 490 472 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 491 return m->bd-> fHotPluggable;473 return m->bd->mData.fHotPluggable; 492 474 } 493 475 494 476 Utf8Str& MediumAttachment::i_getBandwidthGroup() const 495 477 { 496 return m->bd-> strBandwidthGroup;478 return m->bd->mData.strBwGroup; 497 479 } 498 480 … … 500 482 { 501 483 return ( aControllerName == m->bd->strControllerName 502 && aPort == m->bd-> lPort503 && aDevice == m->bd-> lDevice);484 && aPort == m->bd->mData.lPort 485 && aDevice == m->bd->mData.lDevice); 504 486 } 505 487 … … 533 515 534 516 m->bd.backup(); 535 m->bd-> fPassthrough = aPassthrough;517 m->bd->mData.fPassThrough = aPassthrough; 536 518 } 537 519 … … 542 524 543 525 m->bd.backup(); 544 m->bd-> fTempEject = aTempEject;526 m->bd->mData.fTempEject = aTempEject; 545 527 } 546 528 … … 559 541 560 542 m->bd.backup(); 561 m->bd-> fNonRotational = aNonRotational;543 m->bd->mData.fNonRotational = aNonRotational; 562 544 } 563 545 … … 568 550 569 551 m->bd.backup(); 570 m->bd-> fDiscard = aDiscard;552 m->bd->mData.fDiscard = aDiscard; 571 553 } 572 554 … … 577 559 578 560 m->bd.backup(); 579 m->bd-> fHotPluggable = aHotPluggable;561 m->bd->mData.fHotPluggable = aHotPluggable; 580 562 } 581 563 … … 586 568 587 569 m->bd.backup(); 588 m->bd-> strBandwidthGroup = aBandwidthGroup;570 m->bd->mData.strBwGroup = aBandwidthGroup; 589 571 590 572 LogFlowThisFuncLeave();
Note:
See TracChangeset
for help on using the changeset viewer.