Changeset 61713 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 15, 2016 1:15:10 PM (9 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MediumAttachmentImpl.h
r56820 r61713 6 6 7 7 /* 8 * Copyright (C) 2006-201 5Oracle Corporation8 * Copyright (C) 2006-2016 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 101 101 void i_updateHotPluggable(bool aHotPluggable); 102 102 103 /** Construct a unique and somewhat descriptive name for logging. */ 104 void i_updateLogName(void); 105 103 106 /** Get a unique and somewhat descriptive name for logging. */ 104 const char *i_getLogName(void) const { return mLogName.c_str(); }107 const char *i_getLogName(void) const { return mLogName.c_str(); } 105 108 106 109 private: -
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r61380 r61713 130 130 m->bd->mData.strBwGroup = strBandwidthGroup; 131 131 unconst(m->bd->strControllerName) = aControllerName; 132 m->bd->mData.lPort 132 m->bd->mData.lPort = aPort; 133 133 m->bd->mData.lDevice = aDevice; 134 m->bd->mData.deviceType 134 m->bd->mData.deviceType = aType; 135 135 136 136 m->bd->mData.fPassThrough = aPassthrough; … … 145 145 146 146 /* Construct a short log name for this attachment. */ 147 Utf8Str ctlName(aControllerName); 148 const char *psz = strpbrk(ctlName.c_str(), " \t:-"); 149 mLogName = Utf8StrFmt("MA%p[%.*s:%u:%u:%s%s]", 150 this, 151 psz ? psz - ctlName.c_str() : 4, ctlName.c_str(), 152 aPort, aDevice, Global::stringifyDeviceType(aType), 153 m->bd->fImplicit ? ":I" : ""); 147 i_updateLogName(); 154 148 155 149 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); … … 167 161 168 162 ComAssertRet(aParent && aThat, E_INVALIDARG); 163 Assert(!aParent->i_isSnapshotMachine()); 169 164 170 165 /* Enclose the state transition NotReady->InInit->Ready */ … … 184 179 autoInitSpan.setSucceeded(); 185 180 181 /* Construct a short log name for this attachment. */ 182 i_updateLogName(); 183 184 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); 186 185 return S_OK; 187 186 } … … 399 398 /* sanity */ 400 399 AutoCaller autoCaller(this); 401 AssertComRCReturnVoid 400 AssertComRCReturnVoid(autoCaller.rc()); 402 401 403 402 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 416 415 void MediumAttachment::i_setImplicit(bool aImplicit) 417 416 { 417 Assert(!m->pMachine->i_isSnapshotMachine()); 418 418 m->bd->fImplicit = aImplicit; 419 420 /* Construct a short log name for this attachment. */ 421 i_updateLogName(); 419 422 } 420 423 … … 490 493 { 491 494 Assert(isWriteLockOnCurrentThread()); 495 Assert(!m->pMachine->i_isSnapshotMachine()); 492 496 493 497 m->bd.backup(); 494 498 unconst(m->bd->strControllerName) = aName; 499 500 /* Construct a short log name for this attachment. */ 501 i_updateLogName(); 495 502 } 496 503 … … 502 509 { 503 510 Assert(isWriteLockOnCurrentThread()); 511 Assert(!m->pMachine->i_isSnapshotMachine()); 504 512 505 513 m->bd.backup(); … … 513 521 { 514 522 Assert(isWriteLockOnCurrentThread()); 523 Assert(!m->pMachine->i_isSnapshotMachine()); 515 524 516 525 m->bd.backup(); … … 522 531 { 523 532 Assert(isWriteLockOnCurrentThread()); 533 Assert(!m->pMachine->i_isSnapshotMachine()); 524 534 525 535 m->bd.backup(); … … 531 541 { 532 542 Assert(isWriteLockOnCurrentThread()); 543 Assert(!m->pMachine->i_isSnapshotMachine()); 533 544 534 545 m->fIsEjected = true; … … 539 550 { 540 551 Assert(isWriteLockOnCurrentThread()); 552 Assert(!m->pMachine->i_isSnapshotMachine()); 541 553 542 554 m->bd.backup(); … … 548 560 { 549 561 Assert(isWriteLockOnCurrentThread()); 562 Assert(!m->pMachine->i_isSnapshotMachine()); 550 563 551 564 m->bd.backup(); … … 557 570 { 558 571 Assert(isWriteLockOnCurrentThread()); 572 Assert(!m->pMachine->i_isSnapshotMachine()); 559 573 560 574 m->bd.backup(); … … 566 580 LogFlowThisFuncEnter(); 567 581 Assert(isWriteLockOnCurrentThread()); 582 Assert(!m->pMachine->i_isSnapshotMachine()); 568 583 569 584 m->bd.backup(); … … 578 593 /* sanity */ 579 594 AutoCaller autoCaller(this); 580 AssertComRCReturnVoid (autoCaller.rc()); 595 AssertComRCReturnVoid(autoCaller.rc()); 596 Assert(!m->pMachine->i_isSnapshotMachine()); 581 597 582 598 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 587 603 } 588 604 605 void MediumAttachment::i_updateLogName() 606 { 607 const char *pszName = m->bd->strControllerName.c_str(); 608 const char *pszEndNick = strpbrk(pszName, " \t:-"); 609 mLogName = Utf8StrFmt("MA%p[%.*s:%u:%u:%s%s]", 610 this, 611 pszEndNick ? pszEndNick - pszName : 4, pszName, 612 m->bd->mData.lPort, m->bd->mData.lDevice, Global::stringifyDeviceType(m->bd->mData.deviceType), 613 m->bd->fImplicit ? ":I" : ""); 614 }
Note:
See TracChangeset
for help on using the changeset viewer.