Changeset 73589 in vbox for trunk/src/VBox
- Timestamp:
- Aug 9, 2018 1:56:15 PM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r73097 r73589 1230 1230 1231 1231 LogFlowFunc(("pDrvIns=%#p fFlags=%#x\n", pDrvIns, fFlags)); 1232 1233 AssertMsgReturnVoid((fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG),1234 ("SCSI: Hotplugging is not supported\n"));1235 1232 1236 1233 /* -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r73003 r73589 4507 4507 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 4508 4508 4509 HRESULT rc = i_checkStateDependency(Mutable StateDep);4509 HRESULT rc = i_checkStateDependency(MutableOrRunningStateDep); 4510 4510 if (FAILED(rc)) return rc; 4511 4511 4512 4512 AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL); 4513 4513 4514 if (Global::IsOnlineOrTransient(mData->mMachineState)) 4514 /* Check for an existing controller. */ 4515 ComObjPtr<StorageController> ctl; 4516 rc = i_getStorageControllerByName(aName, ctl, true /* aSetError */); 4517 if (FAILED(rc)) return rc; 4518 4519 StorageControllerType_T ctrlType; 4520 rc = ctl->COMGETTER(ControllerType)(&ctrlType); 4521 if (FAILED(rc)) 4522 return setError(E_FAIL, 4523 tr("Could not get type of controller '%s'"), 4524 aName.c_str()); 4525 4526 bool fSilent = false; 4527 Utf8Str strReconfig; 4528 4529 /* Check whether the flag to allow silent storage attachment reconfiguration is set. */ 4530 strReconfig = i_getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused")); 4531 if ( mData->mMachineState == MachineState_Paused 4532 && strReconfig == "1") 4533 fSilent = true; 4534 4535 /* Check that the controller can do hotplugging if we detach the device while the VM is running. */ 4536 bool fHotplug = false; 4537 if (!fSilent && Global::IsOnlineOrTransient(mData->mMachineState)) 4538 fHotplug = true; 4539 4540 if (fHotplug && !i_isControllerHotplugCapable(ctrlType)) 4515 4541 return setError(VBOX_E_INVALID_VM_STATE, 4516 tr(" Invalid machine state: %s"),4517 Global::stringifyMachineState(mData->mMachineState));4542 tr("Controller '%s' does not support hotplugging which is required to change the passthrough setting while the VM is running"), 4543 aName.c_str()); 4518 4544 4519 4545 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), … … 4538 4564 pAttach->i_updatePassthrough(!!aPassthrough); 4539 4565 4540 return S_OK; 4566 attLock.release(); 4567 alock.release(); 4568 rc = i_onStorageDeviceChange(pAttach, FALSE /* aRemove */, FALSE /* aSilent */); 4569 4570 return rc; 4541 4571 } 4542 4572
Note:
See TracChangeset
for help on using the changeset viewer.