Changeset 48879 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Oct 4, 2013 8:37:50 AM (11 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r48735 r48879 4501 4501 false /* fNonRotational */, 4502 4502 false /* fDiscard */, 4503 false /* fHotPluggable */, 4503 4504 Utf8Str::Empty); 4504 4505 if (FAILED(rc)) return rc; … … 4828 4829 aDevice, aControllerPort, aControllerName); 4829 4830 pAttach->updateDiscard(!!aDiscard); 4831 4832 return S_OK; 4833 } 4834 4835 STDMETHODIMP Machine::SetHotPluggableForDevice(IN_BSTR aControllerName, LONG aControllerPort, 4836 LONG aDevice, BOOL aHotPluggable) 4837 { 4838 CheckComArgStrNotEmptyOrNull(aControllerName); 4839 4840 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aHotPluggable=%d\n", 4841 aControllerName, aControllerPort, aDevice, aHotPluggable)); 4842 4843 AutoCaller autoCaller(this); 4844 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 4845 4846 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 4847 4848 HRESULT rc = checkStateDependency(MutableStateDep); 4849 if (FAILED(rc)) return rc; 4850 4851 AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL); 4852 4853 if (Global::IsOnlineOrTransient(mData->mMachineState)) 4854 return setError(VBOX_E_INVALID_VM_STATE, 4855 tr("Invalid machine state: %s"), 4856 Global::stringifyMachineState(mData->mMachineState)); 4857 4858 MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments, 4859 aControllerName, 4860 aControllerPort, 4861 aDevice); 4862 if (!pAttach) 4863 return setError(VBOX_E_OBJECT_NOT_FOUND, 4864 tr("No storage device attached to device slot %d on port %d of controller '%ls'"), 4865 aDevice, aControllerPort, aControllerName); 4866 4867 /** @todo remove this blocker and add the missing code to support this 4868 * flag properly in all code areas, with proper support checks below. */ 4869 return setError(VBOX_E_NOT_SUPPORTED, 4870 tr("Controller '%ls' does not support changing the hot-pluggable device flag"), 4871 aControllerName); 4872 4873 setModified(IsModified_Storage); 4874 mMediaData.backup(); 4875 4876 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4877 4878 if (pAttach->getType() == DeviceType_Floppy) 4879 return setError(E_INVALIDARG, 4880 tr("Setting the hot-pluggable device flag rejected as the device attached to device slot %d on port %d of controller '%ls' is a floppy drive"), 4881 aDevice, aControllerPort, aControllerName); 4882 pAttach->updateHotPluggable(!!aHotPluggable); 4830 4883 4831 4884 return S_OK; … … 9716 9769 dev.fNonRotational, 9717 9770 dev.fDiscard, 9771 /// @todo load setting once the hot-pluggable flag works 9772 false /*dev.fHotPluggable*/, 9718 9773 pBwGroup.isNull() ? Utf8Str::Empty : pBwGroup->getName()); 9719 9774 if (FAILED(rc)) break; … … 10819 10874 dev.lDevice = pAttach->getDevice(); 10820 10875 dev.fPassThrough = pAttach->getPassthrough(); 10876 /// @todo save setting once the hot-pluggable flag works 10877 dev.fHotPluggable = false /* pAttach->getHotPluggable()*/; 10821 10878 if (pMedium) 10822 10879 { … … 11161 11218 pAtt->getNonRotational(), 11162 11219 pAtt->getDiscard(), 11220 pAtt->getHotPluggable(), 11163 11221 pAtt->getBandwidthGroup()); 11164 11222 if (FAILED(rc)) throw rc; … … 12777 12835 { 12778 12836 Bstr name; 12779 12837 12780 12838 hrc = mNetworkAdapters[slot]->COMGETTER(NATNetwork)(name.asOutParam()); 12781 12839 if (SUCCEEDED(hrc)) -
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r38873 r48879 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 fNonRotational(false), 44 44 fDiscard(false), 45 fImplicit(false) 45 fImplicit(false), 46 fHotPluggable(false) 46 47 { } 47 48 … … 63 64 bool fDiscard; 64 65 bool fImplicit; 66 bool fHotPluggable; 65 67 }; 66 68 … … 123 125 bool aNonRotational, 124 126 bool aDiscard, 127 bool aHotPluggable, 125 128 const Utf8Str &strBandwidthGroup) 126 129 { 127 130 LogFlowThisFuncEnter(); 128 LogFlowThisFunc(("aParent=%p aMedium=%p aControllerName=%ls aPort=%d aDevice=%d aType=%d aImplicit=%d aPassthrough=%d aTempEject=%d aNonRotational=%d strBandwithGroup=%s\n", aParent, aMedium, aControllerName.raw(), aPort, aDevice, aType, aImplicit, aPassthrough, aTempEject, aNonRotational, strBandwidthGroup.c_str()));131 LogFlowThisFunc(("aParent=%p aMedium=%p aControllerName=%ls aPort=%d aDevice=%d aType=%d aImplicit=%d aPassthrough=%d aTempEject=%d aNonRotational=%d aDiscard=%d aHotPluggable=%d strBandwithGroup=%s\n", aParent, aMedium, aControllerName.raw(), aPort, aDevice, aType, aImplicit, aPassthrough, aTempEject, aNonRotational, aDiscard, aHotPluggable, strBandwidthGroup.c_str())); 129 132 130 133 if (aType == DeviceType_HardDisk) … … 152 155 m->bd->fDiscard = aDiscard; 153 156 m->bd->fImplicit = aImplicit; 157 m->bd->fHotPluggable = aHotPluggable; 154 158 155 159 /* Confirm a successful initialization when it's the case */ … … 417 421 } 418 422 423 STDMETHODIMP MediumAttachment::COMGETTER(HotPluggable)(BOOL *aHotPluggable) 424 { 425 LogFlowThisFuncEnter(); 426 427 CheckComArgOutPointerValid(aHotPluggable); 428 429 AutoCaller autoCaller(this); 430 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 431 432 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 433 434 *aHotPluggable = m->bd->fHotPluggable; 435 436 LogFlowThisFuncLeave(); 437 return S_OK; 438 } 439 419 440 /** 420 441 * @note Locks this object for writing. … … 511 532 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 512 533 return m->bd->fDiscard; 534 } 535 536 bool MediumAttachment::getHotPluggable() const 537 { 538 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); 539 return m->bd->fHotPluggable; 513 540 } 514 541
Note:
See TracChangeset
for help on using the changeset viewer.