Changeset 49190 in vbox
- Timestamp:
- Oct 18, 2013 3:26:52 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 90067
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r49058 r49190 959 959 fTempEject(false), 960 960 fNonRotational(false), 961 fDiscard(false), 962 fHotPluggable(false), 961 963 lPort(0), 962 964 lDevice(0) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r49103 r49190 535 535 " [--nonrotational on|off]\n" 536 536 " [--discard on|off]\n" 537 " [--hotpluggable on|off]\n" 537 538 " [--bandwidthgroup <name>]\n" 538 539 " [--forceunmount]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r48985 r49190 55 55 { "--nonrotational", 'n', RTGETOPT_REQ_STRING }, 56 56 { "--discard", 'u', RTGETOPT_REQ_STRING }, 57 { "--hotpluggable", 'o', RTGETOPT_REQ_STRING }, 57 58 { "--bandwidthgroup", 'b', RTGETOPT_REQ_STRING }, 58 59 { "--forceunmount", 'f', RTGETOPT_REQ_NOTHING }, … … 91 92 const char *pszNonRotational = NULL; 92 93 const char *pszDiscard = NULL; 94 const char *pszHotPluggable = NULL; 93 95 const char *pszBandwidthGroup = NULL; 94 96 Bstr bstrNewUuid; … … 199 201 if (ValueUnion.psz) 200 202 pszDiscard = ValueUnion.psz; 203 else 204 rc = E_FAIL; 205 break; 206 } 207 208 case 'o': // hotpluggable <on|off> 209 { 210 if (ValueUnion.psz) 211 pszHotPluggable = ValueUnion.psz; 201 212 else 202 213 rc = E_FAIL; … … 853 864 } 854 865 866 if ( pszHotPluggable 867 && (SUCCEEDED(rc))) 868 { 869 ComPtr<IMediumAttachment> mattach; 870 CHECK_ERROR(machine, GetMediumAttachment(Bstr(pszCtl).raw(), port, 871 device, mattach.asOutParam())); 872 873 if (SUCCEEDED(rc)) 874 { 875 if (!RTStrICmp(pszHotPluggable, "on")) 876 { 877 CHECK_ERROR(machine, SetHotPluggableForDevice(Bstr(pszCtl).raw(), 878 port, device, TRUE)); 879 } 880 else if (!RTStrICmp(pszHotPluggable, "off")) 881 { 882 CHECK_ERROR(machine, SetHotPluggableForDevice(Bstr(pszCtl).raw(), 883 port, device, FALSE)); 884 } 885 else 886 throw Utf8StrFmt("Invalid --hotpluggable argument '%s'", pszHotPluggable); 887 } 888 else 889 throw Utf8StrFmt("Couldn't find the controller attachment for the controller '%s'\n", pszCtl); 890 } 855 891 856 892 if ( pszBandwidthGroup -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r49069 r49190 1947 1947 lPortUsed[u32HDSataPortCount++] = lPortNum; 1948 1948 LogFlowFunc(("HD Sata port Count=%d\n", u32HDSataPortCount)); 1949 } 1950 1951 /* Configure the hotpluggable flag for the port. */ 1952 BOOL fHotPluggable = FALSE; 1953 hrc = pMediumAtt->COMGETTER(HotPluggable)(&fHotPluggable); H(); 1954 if (SUCCEEDED(hrc)) 1955 { 1956 PCFGMNODE pPortCfg; 1957 char szName[24]; 1958 RTStrPrintf(szName, sizeof(szName), "Port%d", lPortNum); 1959 1960 InsertConfigNode(pCfg, szName, &pPortCfg); 1961 InsertConfigInteger(pPortCfg, "Hotpluggable", fHotPluggable ? 1 : 0); 1949 1962 } 1950 1963 } -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r49058 r49190 4512 4512 false /* fNonRotational */, 4513 4513 false /* fDiscard */, 4514 f alse/* fHotPluggable */,4514 fHotplug /* fHotPluggable */, 4515 4515 Utf8Str::Empty); 4516 4516 if (FAILED(rc)) return rc; … … 4641 4641 aDevice, aControllerPort, aControllerName); 4642 4642 4643 if (fHotplug && !pAttach->getHotPluggable()) 4644 return setError(VBOX_E_NOT_SUPPORTED, 4645 tr("The device slot %d on port %d of controller '%ls' does not support hotplugging"), 4646 aDevice, aControllerPort, aControllerName); 4647 4643 4648 /* 4644 4649 * The VM has to detach the device before we delete any implicit diffs. … … 4876 4881 aDevice, aControllerPort, aControllerName); 4877 4882 4878 /** @todo remove this blocker and add the missing code to support this 4879 * flag properly in all code areas, with proper support checks below. */ 4883 /* Check for an existing controller. */ 4884 ComObjPtr<StorageController> ctl; 4885 rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */); 4886 if (FAILED(rc)) return rc; 4887 4888 StorageControllerType_T ctrlType; 4889 rc = ctl->COMGETTER(ControllerType)(&ctrlType); 4890 if (FAILED(rc)) 4891 return setError(E_FAIL, 4892 tr("Could not get type of controller '%ls'"), 4893 aControllerName); 4894 4895 if (!isControllerHotplugCapable(ctrlType)) 4880 4896 return setError(VBOX_E_NOT_SUPPORTED, 4881 4897 tr("Controller '%ls' does not support changing the hot-pluggable device flag"), … … 9781 9797 dev.fNonRotational, 9782 9798 dev.fDiscard, 9783 /// @todo load setting once the hot-pluggable flag works 9784 false /*dev.fHotPluggable*/, 9799 dev.fHotPluggable, 9785 9800 pBwGroup.isNull() ? Utf8Str::Empty : pBwGroup->getName()); 9786 9801 if (FAILED(rc)) break; … … 10887 10902 dev.lDevice = pAttach->getDevice(); 10888 10903 dev.fPassThrough = pAttach->getPassthrough(); 10889 /// @todo save setting once the hot-pluggable flag works 10890 dev.fHotPluggable = false /* pAttach->getHotPluggable()*/; 10904 dev.fHotPluggable = pAttach->getHotPluggable(); 10891 10905 if (pMedium) 10892 10906 { -
trunk/src/VBox/Main/xml/Settings.cpp
r49066 r49190 3442 3442 att.fDiscard = false; 3443 3443 att.fNonRotational = false; 3444 att.fHotPluggable = false; 3444 3445 3445 3446 if (strTemp == "HardDisk")
Note:
See TracChangeset
for help on using the changeset viewer.