Changeset 23928 in vbox
- Timestamp:
- Oct 21, 2009 10:17:08 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53737
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r23873 r23928 1012 1012 case MODIFYVM_DVDPASSTHROUGH: // deprecated 1013 1013 { 1014 ComPtr<IMediumAttachment> dvdAttachment; 1015 machine->GetMediumAttachment(Bstr("IDE Controller"), 1, 0, dvdAttachment.asOutParam()); 1016 ASSERT(dvdAttachment); 1017 1018 CHECK_ERROR (dvdAttachment, COMSETTER(Passthrough)(!strcmp(ValueUnion.psz, "on"))); 1014 CHECK_ERROR (machine, PassthroughDevice(Bstr("IDE Controller"), 1, 0, !strcmp(ValueUnion.psz, "on"))); 1019 1015 break; 1020 1016 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r23902 r23928 459 459 if (!RTStrICmp(pszPassThrough, "on")) 460 460 { 461 CHECK_ERROR (ma ttach, COMSETTER(Passthrough)(true));461 CHECK_ERROR (machine, PassthroughDevice(Bstr(pszCtl), port, device, TRUE)); 462 462 } 463 463 else if (!RTStrICmp(pszPassThrough, "off")) 464 464 { 465 CHECK_ERROR (ma ttach, COMSETTER(Passthrough)(false));465 CHECK_ERROR (machine, PassthroughDevice(Bstr(pszCtl), port, device, FALSE)); 466 466 } 467 467 else -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp
r23854 r23928 1789 1789 QString attMediumId = mStorageModel->data (attIndex, StorageModel::R_AttMediumId).toString(); 1790 1790 mMachine.AttachDevice (ctrName, attStorageSlot.port, attStorageSlot.device, attDeviceType, attMediumId); 1791 CMediumAttachment attachment = mMachine.GetMediumAttachment (ctrName, attStorageSlot.port, attStorageSlot.device);1792 attachment.SetPassthrough (mStorageModel->data (attIndex, StorageModel::R_AttIsHostDrive).toBool() &&1793 mStorageModel->data (attIndex, StorageModel::R_AttIsPassthrough).toBool());1791 if (attDeviceType == KDeviceType_DVD) 1792 mMachine.PassthroughDevice (ctrName, attStorageSlot.port, attStorageSlot.device, 1793 mStorageModel->data (attIndex, StorageModel::R_AttIsPassthrough).toBool()); 1794 1794 maxUsedPort = attStorageSlot.port > maxUsedPort ? attStorageSlot.port : maxUsedPort; 1795 1795 } -
trunk/src/VBox/Main/MachineImpl.cpp
r23921 r23928 2518 2518 * still refers to the original and is not valid for the copy */ 2519 2519 mMediaData->mAttachments.remove(pAttach); 2520 2521 return S_OK; 2522 } 2523 2524 STDMETHODIMP Machine::PassthroughDevice(IN_BSTR aControllerName, LONG aControllerPort, 2525 LONG aDevice, BOOL aPassthrough) 2526 { 2527 CheckComArgNotNull(aControllerName); 2528 2529 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld aPassthrough=%d\n", 2530 aControllerName, aControllerPort, aDevice, aPassthrough)); 2531 2532 AutoCaller autoCaller(this); 2533 CheckComRCReturnRC(autoCaller.rc()); 2534 2535 AutoWriteLock alock(this); 2536 2537 HRESULT rc = checkStateDependency(MutableStateDep); 2538 CheckComRCReturnRC(rc); 2539 2540 AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL); 2541 2542 if (Global::IsOnlineOrTransient(mData->mMachineState)) 2543 return setError(VBOX_E_INVALID_VM_STATE, 2544 tr("Invalid machine state: %s"), 2545 Global::stringifyMachineState(mData->mMachineState)); 2546 2547 MediumAttachment *pAttach = findAttachment(mMediaData->mAttachments, 2548 aControllerName, 2549 aControllerPort, 2550 aDevice); 2551 if (!pAttach) 2552 return setError(VBOX_E_OBJECT_NOT_FOUND, 2553 tr("No storage device attached to device slot %d on port %d of controller '%ls'"), 2554 aDevice, aControllerPort, aControllerName); 2555 2556 2557 mMediaData.backup(); 2558 2559 AutoWriteLock attLock(pAttach); 2560 2561 if (pAttach->type() != DeviceType_DVD) 2562 return setError(E_INVALIDARG, 2563 tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"), 2564 aDevice, aControllerPort, aControllerName); 2565 pAttach->updatePassthrough(aPassthrough); 2520 2566 2521 2567 return S_OK; -
trunk/src/VBox/Main/MediumAttachmentImpl.cpp
r23914 r23928 247 247 } 248 248 249 STDMETHODIMP MediumAttachment::COMSETTER(Passthrough)(BOOL aPassthrough)250 {251 LogFlowThisFuncEnter();252 253 AutoCaller autoCaller(this);254 CheckComRCReturnRC(autoCaller.rc());255 256 /** @todo the entire passthrough handling can only be enabled after the257 * MediumAttachment handling in Machine is fixed. */258 #if 0259 /* the machine need to be mutable */260 Machine::AutoMutableStateDependency adep(mParent);261 CheckComRCReturnRC(adep.rc());262 263 AutoWriteLock lock(this);264 265 if (m->passthrough != !!aPassthrough)266 {267 m.backup();268 m->passthrough = !!aPassthrough;269 }270 #endif271 272 LogFlowThisFuncLeave();273 return S_OK;274 }275 276 249 STDMETHODIMP MediumAttachment::COMGETTER(Passthrough)(BOOL *aPassthrough) 277 250 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r23897 r23928 4060 4060 <interface 4061 4061 name="IMachine" extends="$unknown" 4062 uuid="d 867a463-0f78-4ec7-a876-8da001464537"4062 uuid="db35f17a-179f-4332-91b2-a49d5cfb678c" 4063 4063 wsmap="managed" 4064 4064 > … … 4751 4751 </method> 4752 4752 4753 <method name="passthroughDevice"> 4754 <desc> 4755 Sets the passthrough mode of an existing DVD device. Changing the 4756 setting while the VM is running is forbidden. The setting is only used 4757 if at VM start the device is configured as a host DVD drive, in all 4758 other cases it is ignored. The device must already exist; see 4759 <link to="IMachine::attachDevice"/> for how to attach a new device. 4760 4761 The @a controllerPort and @a device parameters specify the device slot and 4762 have have the same meaning as with <link to="IMachine::attachDevice" />. 4763 4764 <result name="E_INVALIDARG"> 4765 SATA device, SATA port, IDE port or IDE slot out of range. 4766 </result> 4767 <result name="VBOX_E_INVALID_OBJECT_STATE"> 4768 Attempt to modify an unregistered virtual machine. 4769 </result> 4770 <result name="VBOX_E_INVALID_VM_STATE"> 4771 Invalid machine state. 4772 </result> 4773 4774 </desc> 4775 <param name="name" type="wstring" dir="in"> 4776 <desc>Name of the storage controller.</desc> 4777 </param> 4778 <param name="controllerPort" type="long" dir="in"> 4779 <desc>Storage controller port.</desc> 4780 </param> 4781 <param name="device" type="long" dir="in"> 4782 <desc>Device slot in the given port.</desc> 4783 </param> 4784 <param name="passthrough" type="boolean" dir="in"> 4785 <desc>New value for the passthrough setting.</desc> 4786 </param> 4787 </method> 4788 4753 4789 <method name="mountMedium"> 4754 4790 <desc> … … 8363 8399 <interface 8364 8400 name="IMediumAttachment" extends="$unknown" 8365 uuid=" ff554585-560a-489d-963c-cf6da6a826de"8401 uuid="7bb6ac41-8c03-4863-9eea-d9c76561b8d1" 8366 8402 wsmap="struct" 8367 8403 > … … 8400 8436 </attribute> 8401 8437 8402 <attribute name="passthrough" type="boolean" readonly=" no">8438 <attribute name="passthrough" type="boolean" readonly="yes"> 8403 8439 <desc>Pass I/O requests through to a device on the host.</desc> 8404 8440 </attribute> -
trunk/src/VBox/Main/include/MachineImpl.h
r23882 r23928 577 577 LONG aDevice, DeviceType_T aType, IN_BSTR aId); 578 578 STDMETHOD(DetachDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice); 579 STDMETHOD(PassthroughDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aPassthrough); 579 580 STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort, 580 581 LONG aDevice, IN_BSTR aId); -
trunk/src/VBox/Main/include/MediumAttachmentImpl.h
r23914 r23928 74 74 STDMETHOD(COMGETTER(Type))(DeviceType_T *aType); 75 75 STDMETHOD(COMGETTER(Passthrough))(BOOL *aPassthrough); 76 STDMETHOD(COMSETTER(Passthrough))(BOOL aPassthrough);77 76 78 77 // unsafe inline public methods for internal purposes only (ensure there is … … 102 101 m->medium = aMedium; 103 102 m->implicit = aImplicit; 103 } 104 105 /** Must be called from under this object's write lock. */ 106 void updatePassthrough(bool aPassthrough) 107 { 108 m.backup(); 109 m->passthrough = aPassthrough; 104 110 } 105 111
Note:
See TracChangeset
for help on using the changeset viewer.