Changeset 29480 in vbox
- Timestamp:
- May 14, 2010 3:24:19 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r29463 r29480 764 764 ulPortCount(2), 765 765 ulInstance(0), 766 ioBackendType(IoBackendType_Buffered),766 fUseHostIOCache(true), 767 767 lIDE0MasterEmulationPort(0), 768 768 lIDE0SlaveEmulationPort(0), … … 778 778 uint32_t ulPortCount; 779 779 uint32_t ulInstance; 780 IoBackendType_T ioBackendType;780 bool fUseHostIOCache; 781 781 782 782 // only for when controllerType == StorageControllerType_IntelAhci: -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r29465 r29480 447 447 " [--sataideemulation<1-4> <1-30>]\n" 448 448 " [--sataportcount <1-30>]\n" 449 " [-- iobackend Buffered|Unbuffered]\n"449 " [--hostiocache on|off]\n" 450 450 " [--remove]\n" 451 451 "\n"); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r28800 r29480 653 653 { "--sataportcount", 'p', RTGETOPT_REQ_UINT32 }, 654 654 { "--remove", 'r', RTGETOPT_REQ_NOTHING }, 655 { "-- iobackend",'i', RTGETOPT_REQ_STRING },655 { "--hostiocache", 'i', RTGETOPT_REQ_STRING }, 656 656 }; 657 657 … … 663 663 const char *pszBusType = NULL; 664 664 const char *pszCtlType = NULL; 665 const char *psz IoBackend= NULL;665 const char *pszHostIOCache = NULL; 666 666 ULONG satabootdev = ~0U; 667 667 ULONG sataidedev = ~0U; … … 732 732 case 'i': 733 733 { 734 psz IoBackend= ValueUnion.psz;734 pszHostIOCache = ValueUnion.psz; 735 735 break; 736 736 } … … 921 921 } 922 922 923 if ( psz IoBackend923 if ( pszHostIOCache 924 924 && SUCCEEDED(rc)) 925 925 { 926 927 928 929 930 if (!RTStrICmp(pszIoBackend, "buffered"))931 932 CHECK_ERROR(ctl, COMSETTER(IoBackend)(IoBackendType_Buffered));933 934 else if (!RTStrICmp(pszIoBackend, "unbuffered"))935 936 CHECK_ERROR(ctl, COMSETTER(IoBackend)(IoBackendType_Unbuffered));937 938 939 940 errorArgument("Invalid --type argument '%s'", pszIoBackend);941 942 926 ComPtr<IStorageController> ctl; 927 928 CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam())); 929 930 if (!RTStrICmp(pszHostIOCache, "on")) 931 { 932 CHECK_ERROR(ctl, COMSETTER(UseHostIOCache)(TRUE)); 933 } 934 else if (!RTStrICmp(pszHostIOCache, "off")) 935 { 936 CHECK_ERROR(ctl, COMSETTER(UseHostIOCache)(FALSE)); 937 } 938 else 939 { 940 errorArgument("Invalid --hostiocache argument '%s'", pszHostIOCache); 941 rc = E_FAIL; 942 } 943 943 } 944 944 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp
r29199 r29480 1796 1796 QUuid ctrId = QUuid (mStorageModel->data (ctrIndex, StorageModel::R_ItemId).toString()); 1797 1797 1798 bool useIoCache = true; 1799 if (controller.GetIoBackend() == KIoBackendType_Unbuffered) 1800 useIoCache = false; 1798 bool useIoCache = controller.GetUseHostIOCache(); 1801 1799 1802 1800 mStorageModel->setData (ctrIndex, useIoCache, StorageModel::R_CtrIoCache); … … 1844 1842 CStorageController ctr = mMachine.AddStorageController (ctrName, ctrBusType); 1845 1843 ctr.SetControllerType (ctrType); 1846 ctr.Set IoBackend(useIoCache ? KIoBackendType_Buffered : KIoBackendType_Unbuffered);1844 ctr.SetUseHostIOCache(useIoCache); 1847 1845 int maxUsedPort = -1; 1848 1846 for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j) -
trunk/src/VBox/Main/ConsoleImpl.cpp
r29363 r29480 3215 3215 rc = ctrl->COMGETTER(Instance)(&uInstance); 3216 3216 AssertComRC(rc); 3217 IoBackendType_T enmIoBackend;3218 rc = ctrl->COMGETTER( IoBackend)(&enmIoBackend);3217 BOOL fUseHostIOCache; 3218 rc = ctrl->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 3219 3219 AssertComRC(rc); 3220 3220 … … 3229 3229 */ 3230 3230 PVMREQ pReq; 3231 int vrc = VMR3ReqCall(mpVM, VMCPUID_ANY, &pReq, 0 /* no wait! */, VMREQFLAGS_VBOX_STATUS, 3232 (PFNRT)Console::changeRemovableMedium, 7, 3233 this, pszDevice, uInstance, enmBus, enmIoBackend, 3234 aMediumAttachment, fForce); 3231 int vrc = VMR3ReqCall(mpVM, 3232 VMCPUID_ANY, 3233 &pReq, 3234 0 /* no wait! */, 3235 VMREQFLAGS_VBOX_STATUS, 3236 (PFNRT)Console::changeRemovableMedium, 3237 7, 3238 this, 3239 pszDevice, 3240 uInstance, 3241 enmBus, 3242 fUseHostIOCache, 3243 aMediumAttachment, 3244 fForce); 3235 3245 3236 3246 /* leave the lock before waiting for a result (EMT will call us back!) */ … … 3285 3295 unsigned uInstance, 3286 3296 StorageBus_T enmBus, 3287 IoBackendType_T enmIoBackend,3297 bool fUseHostIOCache, 3288 3298 IMediumAttachment *aMediumAtt, 3289 3299 bool fForce) … … 3348 3358 uInstance, 3349 3359 enmBus, 3350 enmIoBackend,3360 fUseHostIOCache, 3351 3361 false /* fSetupMerge */, 3352 3362 0 /* uMergeSource */, … … 4461 4471 rc = ctrl->COMGETTER(Instance)(&uInstance); 4462 4472 AssertComRC(rc); 4463 IoBackendType_T enmIoBackend;4464 rc = ctrl->COMGETTER( IoBackend)(&enmIoBackend);4473 BOOL fUseHostIOCache; 4474 rc = ctrl->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 4465 4475 AssertComRC(rc); 4466 4476 … … 4492 4502 uInstance, 4493 4503 enmBus, 4494 enmIoBackend,4504 fUseHostIOCache, 4495 4505 true /* fSetupMerge */, 4496 4506 aSourceIdx, … … 4567 4577 uInstance, 4568 4578 enmBus, 4569 enmIoBackend,4579 fUseHostIOCache, 4570 4580 false /* fSetupMerge */, 4571 4581 0 /* uMergeSource */, … … 7565 7575 unsigned uInstance, 7566 7576 StorageBus_T enmBus, 7567 IoBackendType_T enmIoBackend,7577 bool fUseHostIOCache, 7568 7578 bool fSetupMerge, 7569 7579 unsigned uMergeSource, … … 7599 7609 uInstance, 7600 7610 enmBus, 7601 enmIoBackend,7611 fUseHostIOCache, 7602 7612 fSetupMerge, 7603 7613 uMergeSource, … … 7745 7755 StorageControllerType_T enmController; 7746 7756 StorageBus_T enmBus; 7747 IoBackendType_T enmIoBackend;7757 BOOL fUseHostIOCache; 7748 7758 7749 7759 /* … … 7769 7779 if (FAILED(rc)) 7770 7780 throw rc; 7771 rc = controller->COMGETTER( IoBackend)(&enmIoBackend);7781 rc = controller->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 7772 7782 if (FAILED(rc)) 7773 7783 throw rc; … … 7788 7798 lInstance, 7789 7799 enmBus, 7790 enmIoBackend,7800 fUseHostIOCache, 7791 7801 false /* fSetupMerge */, 7792 7802 0 /* uMergeSource */, -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r29444 r29480 1032 1032 rc = ctrls[i]->COMGETTER(Instance)(&ulInstance); H(); 1033 1033 1034 IoBackendType_T enmIoBackend;1035 rc = ctrls[i]->COMGETTER( IoBackend)(&enmIoBackend);H();1034 BOOL fUseHostIOCache; 1035 rc = ctrls[i]->COMGETTER(UseHostIOCache)(&fUseHostIOCache); H(); 1036 1036 1037 1037 /* /Devices/<ctrldev>/ */ … … 1226 1226 ulInstance, 1227 1227 enmBus, 1228 enmIoBackend,1228 fUseHostIOCache, 1229 1229 false /* fSetupMerge */, 1230 1230 0 /* uMergeSource */, … … 2236 2236 unsigned uInstance, 2237 2237 StorageBus_T enmBus, 2238 IoBackendType_T enmIoBackend,2238 bool fUseHostIOCache, 2239 2239 bool fSetupMerge, 2240 2240 unsigned uMergeSource, … … 2325 2325 !!fPassthrough, 2326 2326 lType, 2327 enmIoBackend,2327 fUseHostIOCache, 2328 2328 fSetupMerge, 2329 2329 uMergeSource, … … 2356 2356 bool fPassthrough, 2357 2357 DeviceType_T enmType, 2358 IoBackendType_T enmIoBackend,2358 bool fUseHostIOCache, 2359 2359 bool fSetupMerge, 2360 2360 unsigned uMergeSource, … … 2504 2504 } 2505 2505 2506 if ( enmIoBackend == IoBackendType_Unbuffered)2506 if (!fUseHostIOCache) 2507 2507 { 2508 2508 rc = CFGMR3InsertInteger(pCfg, "UseNewIo", 1); RC_CHECK(); -
trunk/src/VBox/Main/MachineImpl.cpp
r29470 r29480 6956 6956 if (FAILED(rc)) return rc; 6957 6957 6958 rc = pCtl->COMSETTER( IoBackend)(ctlData.ioBackendType);6958 rc = pCtl->COMSETTER(UseHostIOCache)(ctlData.fUseHostIOCache); 6959 6959 if (FAILED(rc)) return rc; 6960 6960 … … 8033 8033 ctl.ulPortCount = portCount; 8034 8034 8035 /* Save I/O backend*/8036 IoBackendType_T ioBackendType;8037 rc = pCtl->COMGETTER( IoBackend)(&ioBackendType);8035 /* Save fUseHostIOCache */ 8036 BOOL fUseHostIOCache; 8037 rc = pCtl->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 8038 8038 ComAssertComRCRet(rc, rc); 8039 ctl. ioBackendType = ioBackendType;8039 ctl.fUseHostIOCache = !!fUseHostIOCache; 8040 8040 8041 8041 /* Save IDE emulation settings. */ -
trunk/src/VBox/Main/StorageControllerImpl.cpp
r29002 r29480 45 45 mInstance(0), 46 46 mPortCount(2), 47 mIoBackendType(IoBackendType_Buffered),47 fUseHostIOCache(true), 48 48 mPortIde0Master(0), 49 49 mPortIde0Slave(1), … … 62 62 /** Number of usable ports. */ 63 63 ULONG mPortCount; 64 /** I/O backend type*/65 IoBackendType_T mIoBackendType;64 /** Whether to use the host IO caches. */ 65 BOOL fUseHostIOCache; 66 66 67 67 /** The following is only for the SATA controller atm. */ … … 145 145 m->bd->mStorageBus = aStorageBus; 146 146 if (aStorageBus != StorageBus_IDE) 147 m->bd-> mIoBackendType = IoBackendType_Unbuffered;147 m->bd->fUseHostIOCache = false; 148 148 else 149 m->bd-> mIoBackendType = IoBackendType_Buffered;149 m->bd->fUseHostIOCache = true; 150 150 151 151 switch (aStorageBus) … … 608 608 } 609 609 610 STDMETHODIMP StorageController::COMGETTER( IoBackend) (IoBackendType_T *aIoBackend)610 STDMETHODIMP StorageController::COMGETTER(UseHostIOCache) (BOOL *fUseHostIOCache) 611 611 { 612 612 AutoCaller autoCaller(this); … … 617 617 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 618 618 619 * aIoBackend = m->bd->mIoBackendType;620 621 return S_OK; 622 } 623 624 STDMETHODIMP StorageController::COMSETTER( IoBackend) (IoBackendType_T aIoBackend)619 *fUseHostIOCache = m->bd->fUseHostIOCache; 620 621 return S_OK; 622 } 623 624 STDMETHODIMP StorageController::COMSETTER(UseHostIOCache) (BOOL fUseHostIOCache) 625 625 { 626 626 AutoCaller autoCaller(this); … … 633 633 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 634 634 635 if (m->bd-> mIoBackendType != aIoBackend)635 if (m->bd->fUseHostIOCache != !!fUseHostIOCache) 636 636 { 637 637 m->bd.backup(); 638 m->bd-> mIoBackendType = aIoBackend;638 m->bd->fUseHostIOCache = !!fUseHostIOCache; 639 639 640 640 alock.release(); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r29460 r29480 1095 1095 </enum> 1096 1096 1097 <enum1097 <!-- <enum 1098 1098 name="IoBackendType" 1099 1099 uuid="2a7e16d1-4e6b-4d5d-b0c9-b9bbe6c5b2ad" … … 1118 1118 </const> 1119 1119 </enum> 1120 1120 --> 1121 1121 1122 1122 <!-- … … 13755 13755 <interface 13756 13756 name="IStorageController" extends="$unknown" 13757 uuid=" 7635f4ec-8a28-44b5-9223-315a87b710fb"13757 uuid="fd93adc0-bbaa-4256-9e6e-00e29f9151c9" 13758 13758 wsmap="managed" 13759 13759 > … … 13838 13838 </attribute> 13839 13839 13840 <attribute name="ioBackend" type="IoBackendType"> 13841 <desc> 13842 The I/O backend to use for the given storage controller. 13840 <attribute name="useHostIOCache" type="boolean"> 13841 <desc> 13842 If true, the storage controller emulation will use a dedicated I/O thread, enable the host I/O 13843 caches and use synchronous file APIs on the host. This was the only option in the API before 13844 VirtualBox 3.2 and is still the default for IDE controllers. 13845 13846 If false, the host I/O cache will be disabled for image files attached to this storage controller. 13847 Instead, the storage controller emulation will use asynchronous I/O APIs on the host. This makes 13848 it possible to turn off the host I/O caches because the emulation can handle unaligned access to 13849 the file. This should be used on OS X and Linux hosts if a high I/O load is expected or many 13850 virtual machines are running at the same time to prevent I/O cache related hangs. 13851 This option new with the API of VirtualBox 3.2 and is now the default for non-IDE storage controllers. 13843 13852 </desc> 13844 13853 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r29385 r29480 442 442 unsigned uInstance, 443 443 StorageBus_T enmBus, 444 IoBackendType_T enmIoBackend,444 bool fUseHostIOCache, 445 445 bool fSetupMerge, 446 446 unsigned uMergeSource, … … 456 456 bool fPassthrough, 457 457 DeviceType_T enmType, 458 IoBackendType_T enmIoBackend,458 bool fUseHostIOCache, 459 459 bool fSetupMerge, 460 460 unsigned uMergeSource, … … 468 468 unsigned uInstance, 469 469 StorageBus_T enmBus, 470 IoBackendType_T enmIoBackend,470 bool fUseHostIOCache, 471 471 bool fSetupMerge, 472 472 unsigned uMergeSource, … … 479 479 unsigned uInstance, 480 480 StorageBus_T enmBus, 481 IoBackendType_T enmIoBackend,481 bool fUseHostIOCache, 482 482 IMediumAttachment *aMediumAtt, 483 483 bool fForce); -
trunk/src/VBox/Main/include/StorageControllerImpl.h
r28800 r29480 73 73 STDMETHOD(COMGETTER(Instance)) (ULONG *aInstance); 74 74 STDMETHOD(COMSETTER(Instance)) (ULONG aInstance); 75 STDMETHOD(COMGETTER( IoBackend)) (IoBackendType_T *aIoBackend);76 STDMETHOD(COMSETTER( IoBackend)) (IoBackendType_T aIoBackend);75 STDMETHOD(COMGETTER(UseHostIOCache)) (BOOL *fUseHostIOCache); 76 STDMETHOD(COMSETTER(UseHostIOCache)) (BOOL fUseHostIOCache); 77 77 78 78 // StorageController methods -
trunk/src/VBox/Main/xml/Settings.cpp
r29462 r29480 1586 1586 && (ulPortCount == s.ulPortCount) 1587 1587 && (ulInstance == s.ulInstance) 1588 && ( ioBackendType == s.ioBackendType)1588 && (fUseHostIOCache == s.fUseHostIOCache) 1589 1589 && (lIDE0MasterEmulationPort == s.lIDE0MasterEmulationPort) 1590 1590 && (lIDE0SlaveEmulationPort == s.lIDE0SlaveEmulationPort) … … 2077 2077 elmStorageController.getAttributeValue("IDE1SlaveEmulationPort", sctl.lIDE1SlaveEmulationPort); 2078 2078 2079 Utf8Str strIoBackend; 2080 if (elmStorageController.getAttributeValue("IoBackend", strIoBackend)) 2081 { 2082 if (strIoBackend == "Buffered") 2083 sctl.ioBackendType = IoBackendType_Buffered; 2084 else if (strIoBackend == "Unbuffered") 2085 sctl.ioBackendType = IoBackendType_Unbuffered; 2086 else 2087 throw ConfigFileError(this, 2088 &elmStorageController, 2089 N_("Invalid value '%s' in StorageController/@IoBackend"), 2090 strIoBackend.c_str()); 2091 } 2079 elmStorageController.getAttributeValue("useHostIOCache", sctl.fUseHostIOCache); 2092 2080 } 2093 2081 … … 3721 3709 pelmController->setAttribute("Instance", sc.ulInstance); 3722 3710 3723 if (m->sv >= SettingsVersion_v1_9) 3724 { 3725 const char *pcszIoBackend; 3726 switch (sc.ioBackendType) 3727 { 3728 case IoBackendType_Unbuffered: pcszIoBackend = "Unbuffered"; break; 3729 default: /*case IoBackendType_Buffered:*/ pcszIoBackend = "Buffered"; break; 3730 } 3731 3732 pelmController->setAttribute("IoBackend", pcszIoBackend); 3733 } 3711 if (m->sv >= SettingsVersion_v1_10) 3712 pelmController->setAttribute("useHostIOCache", sc.fUseHostIOCache); 3734 3713 3735 3714 if (sc.controllerType == StorageControllerType_IntelAhci) … … 3996 3975 ++cFloppies; 3997 3976 3998 // The I/O backend setting is only supported with v.103999 if ( sctl.ioBackendType != IoBackendType_Buffered)3977 // Disabling the host IO cache requires settings version 1.10 3978 if (!sctl.fUseHostIOCache) 4000 3979 { 4001 3980 m->sv = SettingsVersion_v1_10;
Note:
See TracChangeset
for help on using the changeset viewer.