Changeset 28764 in vbox
- Timestamp:
- Apr 26, 2010 4:12:49 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r28581 r28764 758 758 ulPortCount(2), 759 759 ulInstance(0), 760 ioBackendType(IoBackendType_Buffered), 760 761 lIDE0MasterEmulationPort(0), 761 762 lIDE0SlaveEmulationPort(0), … … 767 768 768 769 com::Utf8Str strName; 769 StorageBus_T storageBus; // _SATA, _SCSI, _IDE 770 StorageBus_T storageBus; // _SATA, _SCSI, _IDE, _SAS 770 771 StorageControllerType_T controllerType; 771 772 uint32_t ulPortCount; 772 773 uint32_t ulInstance; 774 IoBackendType_T ioBackendType; 773 775 774 776 // only for when controllerType == StorageControllerType_IntelAhci: -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r28734 r28764 442 442 " [--sataideemulation<1-4> <1-30>]\n" 443 443 " [--sataportcount <1-30>]\n" 444 " [--iobackend Buffered|Unbuffered]\n" 444 445 " [--remove]\n" 445 446 "\n"); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r26517 r28764 657 657 { "--sataportcount", 'p', RTGETOPT_REQ_UINT32 }, 658 658 { "--remove", 'r', RTGETOPT_REQ_NOTHING }, 659 { "--iobackend", 'i', RTGETOPT_REQ_STRING }, 659 660 }; 660 661 … … 666 667 const char *pszBusType = NULL; 667 668 const char *pszCtlType = NULL; 669 const char *pszIoBackend = NULL; 668 670 ULONG satabootdev = ~0U; 669 671 ULONG sataidedev = ~0U; … … 732 734 } 733 735 736 case 'i': 737 { 738 pszIoBackend = ValueUnion.psz; 739 break; 740 } 741 734 742 default: 735 743 { … … 916 924 } 917 925 } 926 927 if ( pszIoBackend 928 && SUCCEEDED(rc)) 929 { 930 ComPtr<IStorageController> ctl; 931 932 CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam())); 933 934 if (!RTStrICmp(pszIoBackend, "buffered")) 935 { 936 CHECK_ERROR(ctl, COMSETTER(IoBackend)(IoBackendType_Buffered)); 937 } 938 else if (!RTStrICmp(pszIoBackend, "unbuffered")) 939 { 940 CHECK_ERROR(ctl, COMSETTER(IoBackend)(IoBackendType_Unbuffered)); 941 } 942 else 943 { 944 errorArgument("Invalid --type argument '%s'", pszIoBackend); 945 rc = E_FAIL; 946 } 947 } 918 948 } 919 949 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r28727 r28764 3090 3090 rc = ctrl->COMGETTER(Instance)(&uInstance); 3091 3091 AssertComRC(rc); 3092 IoBackendType_T enmIoBackend; 3093 rc = ctrl->COMGETTER(Bus)(&enmIoBackend); 3094 AssertComRC(rc); 3092 3095 3093 3096 /* protect mpVM */ … … 3102 3105 PVMREQ pReq; 3103 3106 int vrc = VMR3ReqCall(mpVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 3104 (PFNRT)Console::changeRemovableMedium, 6, 3105 this, pszDevice, uInstance, enmBus, aMediumAttachment, fForce); 3107 (PFNRT)Console::changeRemovableMedium, 7, 3108 this, pszDevice, uInstance, enmBus, enmIoBackend, 3109 aMediumAttachment, fForce); 3106 3110 3107 3111 /* leave the lock before waiting for a result (EMT will call us back!) */ … … 3156 3160 unsigned uInstance, 3157 3161 StorageBus_T enmBus, 3162 IoBackendType_T enmIoBackend, 3158 3163 IMediumAttachment *aMediumAtt, 3159 3164 bool fForce) … … 3215 3220 3216 3221 rcRet = Console::configMediumAttachment(pCtlInst, pcszDevice, uInstance, 3217 enmBus, aMediumAtt,3222 enmBus, enmIoBackend, aMediumAtt, 3218 3223 pThis->mMachineState, 3219 3224 NULL /* phrc */, … … 7218 7223 unsigned uInstance, 7219 7224 StorageBus_T enmBus, 7225 IoBackendType_T enmIoBackend, 7220 7226 IMediumAttachment *aMediumAtt, 7221 7227 MachineState_T aMachineState, … … 7245 7251 /* Update the device instance configuration. */ 7246 7252 rc = Console::configMediumAttachment(pCtlInst, pcszDevice, uInstance, 7247 enmBus, aMediumAtt, aMachineState, 7253 enmBus, enmIoBackend, 7254 aMediumAtt, aMachineState, 7248 7255 phrc, true /* fAttachDetach */, 7249 7256 false /* fForceUnmount */, pVM, … … 7392 7399 StorageControllerType_T enmController; 7393 7400 StorageBus_T enmBus; 7401 IoBackendType_T enmIoBackend; 7394 7402 7395 7403 /* … … 7415 7423 if (FAILED(rc)) 7416 7424 throw rc; 7425 rc = controller->COMGETTER(IoBackend)(&enmIoBackend); 7426 if (FAILED(rc)) 7427 throw rc; 7428 7417 7429 const char *pcszDevice = Console::convertControllerTypeToDev(enmController); 7418 7430 … … 7424 7436 VMCPUID_ANY, 7425 7437 (PFNRT)reconfigureMediumAttachment, 7426 7,7438 8, 7427 7439 that->mpVM, 7428 7440 pcszDevice, 7429 7441 lInstance, 7430 7442 enmBus, 7443 enmIoBackend, 7431 7444 atts[i], 7432 7445 that->mMachineState, -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28727 r28764 1073 1073 rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); H(); 1074 1074 1075 IoBackendType_T enmIoBackend; 1076 rc = ctrls[i]->COMGETTER(IoBackend)(&enmIoBackend); H(); 1077 1075 1078 /* /Devices/<ctrldev>/ */ 1076 1079 const char *pszCtrlDev = pConsole->convertControllerTypeToDev(enmCtrlType); … … 1261 1264 { 1262 1265 rc = Console::configMediumAttachment(pCtlInst, pszCtrlDev, 1263 ulInstance, enmBus, atts[j], 1266 ulInstance, enmBus, enmIoBackend, 1267 atts[j], 1264 1268 pConsole->mMachineState, 1265 1269 NULL /* phrc */, … … 2270 2274 int Console::configMediumAttachment(PCFGMNODE pCtlInst, const char *pcszDevice, 2271 2275 unsigned uInstance, StorageBus_T enmBus, 2276 IoBackendType_T enmIoBackend, 2272 2277 IMediumAttachment *pMediumAtt, 2273 2278 MachineState_T aMachineState, … … 2352 2357 hrc = pMediumAtt->COMGETTER(Passthrough)(&fPassthrough); H(); 2353 2358 rc = Console::configMedium(pLunL0, !!fPassthrough, lType, 2359 enmIoBackend, 2354 2360 pMedium, aMachineState, phrc); RC_CHECK(); 2355 2361 … … 2378 2384 bool fPassthrough, 2379 2385 DeviceType_T enmType, 2386 IoBackendType_T enmIoBackend, 2380 2387 IMedium *pMedium, 2381 2388 MachineState_T aMachineState, … … 2475 2482 { 2476 2483 rc = CFGMR3InsertInteger(pCfg, "TempReadOnly", 1); RC_CHECK(); 2484 } 2485 2486 if (enmIoBackend == IoBackendType_Unbuffered) 2487 { 2488 rc = CFGMR3InsertInteger(pCfg, "UseNewIo", 1); RC_CHECK(); 2477 2489 } 2478 2490 -
trunk/src/VBox/Main/MachineImpl.cpp
r28744 r28764 212 212 213 213 mIoMgrType = IoMgrType_Async; 214 #if defined(RT_OS_LINUX)215 214 mIoBackendType = IoBackendType_Unbuffered; 216 #else217 mIoBackendType = IoBackendType_Buffered;218 #endif219 215 mIoCacheEnabled = true; 220 216 mIoCacheSize = 5; /* 5MB */ … … 6969 6965 if (FAILED(rc)) return rc; 6970 6966 6967 rc = pCtl->COMSETTER(IoBackend)(ctlData.ioBackendType); 6968 if (FAILED(rc)) return rc; 6969 6971 6970 /* Set IDE emulation settings (only for AHCI controller). */ 6972 6971 if (ctlData.controllerType == StorageControllerType_IntelAhci) … … 8027 8026 ComAssertComRCRet(rc, rc); 8028 8027 ctl.ulPortCount = portCount; 8028 8029 /* Save I/O backend */ 8030 IoBackendType_T ioBackendType; 8031 rc = pCtl->COMGETTER(IoBackend)(&ioBackendType); 8032 ComAssertComRCRet(rc, rc); 8033 ctl.ioBackendType = ioBackendType; 8029 8034 8030 8035 /* Save IDE emulation settings. */ -
trunk/src/VBox/Main/StorageControllerImpl.cpp
r27607 r28764 49 49 mInstance(0), 50 50 mPortCount(2), 51 mIoBackendType(IoBackendType_Buffered), 51 52 mPortIde0Master(0), 52 53 mPortIde0Slave(1), … … 65 66 /** Number of usable ports. */ 66 67 ULONG mPortCount; 68 /** I/O backend type */ 69 IoBackendType_T mIoBackendType; 67 70 68 71 /** The following is only for the SATA controller atm. */ … … 145 148 m->bd->mInstance = aInstance; 146 149 m->bd->mStorageBus = aStorageBus; 150 m->bd->mIoBackendType = IoBackendType_Buffered; 147 151 148 152 switch (aStorageBus) … … 605 609 } 606 610 611 STDMETHODIMP StorageController::COMGETTER(IoBackend) (IoBackendType_T *aIoBackend) 612 { 613 AutoCaller autoCaller(this); 614 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 615 616 /* The machine doesn't need to be mutable. */ 617 618 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 619 620 *aIoBackend = m->bd->mIoBackendType; 621 622 return S_OK; 623 } 624 625 STDMETHODIMP StorageController::COMSETTER(IoBackend) (IoBackendType_T aIoBackend) 626 { 627 AutoCaller autoCaller(this); 628 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 629 630 /* the machine needs to be mutable */ 631 AutoMutableStateDependency adep(m->pParent); 632 if (FAILED(adep.rc())) return adep.rc(); 633 634 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 635 636 if (m->bd->mIoBackendType != aIoBackend) 637 { 638 m->bd.backup(); 639 m->bd->mIoBackendType = aIoBackend; 640 641 alock.release(); 642 AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS); // m->pParent is const, needs no locking 643 m->pParent->setModified(Machine::IsModified_Storage); 644 mlock.release(); 645 646 m->pParent->onStorageControllerChange(); 647 } 648 649 return S_OK; 650 } 651 607 652 // IStorageController methods 608 653 ///////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r28748 r28764 13488 13488 <interface 13489 13489 name="IStorageController" extends="$unknown" 13490 uuid=" ce37b7a9-d895-4ee8-b9f8-9579bfc85813"13490 uuid="7635f4ec-8a28-44b5-9223-315a87b710fb" 13491 13491 wsmap="managed" 13492 13492 > … … 13568 13568 13569 13569 For SCSI controllers, the default type is LsiLogic. 13570 </desc> 13571 </attribute> 13572 13573 <attribute name="ioBackend" type="IoBackendType"> 13574 <desc> 13575 The I/O backend to use for the given storage controller. 13570 13576 </desc> 13571 13577 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r28727 r28764 439 439 unsigned uInstance, 440 440 StorageBus_T enmBus, 441 IoBackendType_T enmIoBackend, 441 442 IMediumAttachment *pMediumAtt, 442 443 MachineState_T aMachineState, … … 445 446 DeviceType_T *paLedDevType); 446 447 static int configMedium(PCFGMNODE pLunL0, bool fPassthrough, 447 DeviceType_T enmType, I Medium *pMedium,448 MachineState_T aMachineState, HRESULT *phrc);448 DeviceType_T enmType, IoBackendType_T enmIoBackend, 449 IMedium *pMedium, MachineState_T aMachineState, HRESULT *phrc); 449 450 static DECLCALLBACK(int) reconfigureMediumAttachment(PVM pVM, 450 451 const char *pcszDevice, 451 452 unsigned uInstance, 452 453 StorageBus_T enmBus, 454 IoBackendType_T enmIoBackend, 453 455 IMediumAttachment *aMediumAtt, 454 456 MachineState_T aMachineState, … … 458 460 unsigned uInstance, 459 461 StorageBus_T enmBus, 462 IoBackendType_T enmIoBackend, 460 463 IMediumAttachment *aMediumAtt, 461 464 bool fForce); … … 610 613 iLedScsi = iLedSata + cLedSata, 611 614 cLedScsi = 16, 612 cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi, 615 iLedSas = iLedScsi + cLedScsi, 616 cLedSas = 8, 617 cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas, 613 618 }; 614 619 DeviceType_T maStorageDevType[cLedStorage]; -
trunk/src/VBox/Main/include/StorageControllerImpl.h
r27607 r28764 77 77 STDMETHOD(COMGETTER(Instance)) (ULONG *aInstance); 78 78 STDMETHOD(COMSETTER(Instance)) (ULONG aInstance); 79 STDMETHOD(COMGETTER(IoBackend)) (IoBackendType_T *aIoBackend); 80 STDMETHOD(COMSETTER(IoBackend)) (IoBackendType_T aIoBackend); 79 81 80 82 // StorageController methods -
trunk/src/VBox/Main/xml/Settings.cpp
r28689 r28764 1576 1576 && (ulPortCount == s.ulPortCount) 1577 1577 && (ulInstance == s.ulInstance) 1578 && (ioBackendType == s.ioBackendType) 1578 1579 && (lIDE0MasterEmulationPort == s.lIDE0MasterEmulationPort) 1579 1580 && (lIDE0SlaveEmulationPort == s.lIDE0SlaveEmulationPort) … … 1623 1624 { 1624 1625 ioMgrType = IoMgrType_Async; 1625 #if defined(RT_OS_LINUX)1626 1626 ioBackendType = IoBackendType_Unbuffered; 1627 #else1628 ioBackendType = IoBackendType_Buffered;1629 #endif1630 1627 fIoCacheEnabled = true; 1631 1628 ulIoCacheSize = 5; … … 2064 2061 elmStorageController.getAttributeValue("IDE1MasterEmulationPort", sctl.lIDE1MasterEmulationPort); 2065 2062 elmStorageController.getAttributeValue("IDE1SlaveEmulationPort", sctl.lIDE1SlaveEmulationPort); 2063 2064 Utf8Str strIoBackend; 2065 if (elmStorageController.getAttributeValue("IoBackend", strIoBackend)) 2066 { 2067 if (strIoBackend == "Buffered") 2068 sctl.ioBackendType = IoBackendType_Buffered; 2069 else if (strIoBackend == "Unbuffered") 2070 sctl.ioBackendType = IoBackendType_Unbuffered; 2071 else 2072 throw ConfigFileError(this, 2073 &elmStorageController, 2074 N_("Invalid value '%s' in StorageController/@IoBackend"), 2075 strIoBackend.c_str()); 2076 } 2066 2077 } 2067 2078 … … 3704 3715 pelmController->setAttribute("Instance", sc.ulInstance); 3705 3716 3717 if (m->sv >= SettingsVersion_v1_9) 3718 { 3719 const char *pcszIoBackend; 3720 switch (sc.ioBackendType) 3721 { 3722 case IoBackendType_Unbuffered: pcszIoBackend = "Unbuffered"; break; 3723 default: /*case IoBackendType_Buffered:*/ pcszIoBackend = "Buffered"; break; 3724 } 3725 3726 pelmController->setAttribute("IoBackend", pcszIoBackend); 3727 } 3728 3706 3729 if (sc.controllerType == StorageControllerType_IntelAhci) 3707 3730 { … … 3950 3973 else if (att.deviceType == DeviceType_Floppy) 3951 3974 ++cFloppies; 3975 3976 // The I/O backend setting is only supported with v.10 3977 if (sctl.ioBackendType != IoBackendType_Buffered) 3978 { 3979 m->sv = SettingsVersion_v1_10; 3980 break; 3981 } 3952 3982 } 3953 3983 } … … 4014 4044 || hardwareMachine.ioSettings.ulIoCacheSize != 5 4015 4045 || hardwareMachine.ioSettings.ulIoBandwidthMax != 0 4016 || hardwareMachine.ioSettings.ioMgrType != IoMgrType_Async) 4046 || hardwareMachine.ioSettings.ioMgrType != IoMgrType_Async 4047 || hardwareMachine.ioSettings.ioBackendType != IoBackendType_Unbuffered) 4017 4048 m->sv = SettingsVersion_v1_10; 4018 4019 #if defined(RT_OS_LINUX)4020 if (hardwareMachine.ioSettings.ioBackendType != IoBackendType_Unbuffered)4021 m->sv = SettingsVersion_v1_10;4022 #else4023 if (hardwareMachine.ioSettings.ioBackendType != IoBackendType_Buffered)4024 m->sv = SettingsVersion_v1_10;4025 #endif4026 4049 } 4027 4050 }
Note:
See TracChangeset
for help on using the changeset viewer.