Changeset 25324 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Dec 11, 2009 12:28:58 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r24979 r25324 495 495 case MODIFYVM_BOOT: 496 496 { 497 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > 4))498 return errorSyntax(USAGE_MODIFYVM,499 "Missing or Invalid boot slot number in '%s'",500 GetOptState.pDef->pszLong);501 502 497 if (!strcmp(ValueUnion.psz, "none")) 503 498 { … … 522 517 else 523 518 return errorArgument("Invalid boot device '%s'", ValueUnion.psz); 524 525 519 break; 526 520 } … … 665 659 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam())); 666 660 667 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > 4))668 return errorSyntax(USAGE_MODIFYVM,669 "Missing or Invalid SATA boot slot number in '%s'",670 GetOptState.pDef->pszLong);671 672 if ((ValueUnion.u32 < 1) && (ValueUnion.u32 > 30))673 return errorSyntax(USAGE_MODIFYVM,674 "Missing or Invalid SATA port number in '%s'",675 GetOptState.pDef->pszLong);676 677 661 if (SUCCEEDED(rc)) 678 662 CHECK_ERROR(SataCtl, SetIDEEmulationPort(GetOptState.uIndex, ValueUnion.u32)); 679 680 663 break; 681 664 } … … 688 671 if (SUCCEEDED(rc) && ValueUnion.u32 > 0) 689 672 CHECK_ERROR(SataCtl, COMSETTER(PortCount)(ValueUnion.u32)); 690 691 673 break; 692 674 } … … 694 676 case MODIFYVM_SATAPORT: // deprecated 695 677 { 696 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > 30))697 return errorSyntax(USAGE_MODIFYVM,698 "Missing or Invalid SATA port number in '%s'",699 GetOptState.pDef->pszLong);700 701 678 if (!strcmp(ValueUnion.psz, "none")) 702 679 { … … 717 694 /* open the new hard disk object */ 718 695 CHECK_ERROR(a->virtualBox, 719 720 721 696 OpenHardDisk(Bstr(ValueUnion.psz), AccessMode_ReadWrite, 697 false, Bstr(""), false, 698 Bstr(""), hardDisk.asOutParam())); 722 699 } 723 700 } … … 726 703 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 727 704 CHECK_ERROR(machine, 728 729 705 AttachDevice(Bstr("SATA"), GetOptState.uIndex, 706 0, DeviceType_HardDisk, uuid)); 730 707 } 731 708 else … … 752 729 case MODIFYVM_SCSIPORT: // deprecated 753 730 { 754 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > 16))755 return errorSyntax(USAGE_MODIFYVM,756 "Missing or Invalid SCSI port number in '%s'",757 GetOptState.pDef->pszLong);758 759 731 if (!strcmp(ValueUnion.psz, "none")) 760 732 { … … 1000 972 ComPtr<INetworkAdapter> nic; 1001 973 1002 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1003 return errorSyntax(USAGE_MODIFYVM,1004 "Missing or Invalid NIC slot number in '%s'",1005 GetOptState.pDef->pszLong);1006 1007 974 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1008 975 ASSERT(nic); … … 1016 983 ComPtr<INetworkAdapter> nic; 1017 984 1018 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1019 return errorSyntax(USAGE_MODIFYVM,1020 "Missing or Invalid NIC slot number in '%s'",1021 GetOptState.pDef->pszLong);1022 1023 985 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1024 986 ASSERT(nic); … … 1031 993 { 1032 994 ComPtr<INetworkAdapter> nic; 1033 1034 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1035 return errorSyntax(USAGE_MODIFYVM,1036 "Missing or Invalid NIC slot number in '%s'",1037 GetOptState.pDef->pszLong);1038 995 1039 996 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); … … 1070 1027 else 1071 1028 { 1072 errorArgument("Invalid NIC type '%s' specified for NIC % lu", ValueUnion.psz, GetOptState.uIndex);1029 errorArgument("Invalid NIC type '%s' specified for NIC %u", ValueUnion.psz, GetOptState.uIndex); 1073 1030 rc = E_FAIL; 1074 1031 } … … 1079 1036 { 1080 1037 ComPtr<INetworkAdapter> nic; 1081 1082 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1083 return errorSyntax(USAGE_MODIFYVM,1084 "Missing or Invalid NIC slot number in '%s'",1085 GetOptState.pDef->pszLong);1086 1087 if ((ValueUnion.u32 < 1000) && (ValueUnion.u32 > 4000000))1088 {1089 errorArgument("Invalid --nicspeed%lu argument '%u'", GetOptState.uIndex, ValueUnion.u32);1090 rc = E_FAIL;1091 break;1092 }1093 1038 1094 1039 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); … … 1103 1048 ComPtr<INetworkAdapter> nic; 1104 1049 1105 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1106 return errorSyntax(USAGE_MODIFYVM,1107 "Missing or Invalid NIC slot number in '%s'",1108 GetOptState.pDef->pszLong);1109 1110 1050 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1111 1051 ASSERT(nic); … … 1146 1086 else 1147 1087 { 1148 errorArgument("Invalid type '%s' specfied for NIC % lu", ValueUnion.psz, GetOptState.uIndex);1088 errorArgument("Invalid type '%s' specfied for NIC %u", ValueUnion.psz, GetOptState.uIndex); 1149 1089 rc = E_FAIL; 1150 1090 } … … 1155 1095 { 1156 1096 ComPtr<INetworkAdapter> nic; 1157 1158 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1159 return errorSyntax(USAGE_MODIFYVM,1160 "Missing or Invalid NIC slot number in '%s'",1161 GetOptState.pDef->pszLong);1162 1097 1163 1098 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); … … 1173 1108 ComPtr<INetworkAdapter> nic; 1174 1109 1175 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1176 return errorSyntax(USAGE_MODIFYVM,1177 "Missing or Invalid NIC slot number in '%s'",1178 GetOptState.pDef->pszLong);1179 1180 1110 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1181 1111 ASSERT(nic); … … 1197 1127 ComPtr<INetworkAdapter> nic; 1198 1128 1199 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1200 return errorSyntax(USAGE_MODIFYVM,1201 "Missing or Invalid NIC slot number in '%s'",1202 GetOptState.pDef->pszLong);1203 1204 1129 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1205 1130 ASSERT(nic); … … 1221 1146 ComPtr<INetworkAdapter> nic; 1222 1147 1223 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1224 return errorSyntax(USAGE_MODIFYVM,1225 "Missing or Invalid NIC slot number in '%s'",1226 GetOptState.pDef->pszLong);1227 1228 1148 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1229 1149 ASSERT(nic); 1230 1150 1231 1151 CHECK_ERROR(nic, COMSETTER(NATNetwork)(Bstr(ValueUnion.psz))); 1232 1233 1152 break; 1234 1153 } … … 1237 1156 { 1238 1157 ComPtr<INetworkAdapter> nic; 1239 1240 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > NetworkAdapterCount))1241 return errorSyntax(USAGE_MODIFYVM,1242 "Missing or Invalid NIC slot number in '%s'",1243 GetOptState.pDef->pszLong);1244 1158 1245 1159 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); … … 1262 1176 ComPtr<ISerialPort> uart; 1263 1177 char *pszIRQ = NULL; 1264 1265 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > SerialPortCount))1266 return errorSyntax(USAGE_MODIFYVM,1267 "Missing or Invalid Serial Port number in '%s'",1268 GetOptState.pDef->pszLong);1269 1178 1270 1179 CHECK_ERROR_BREAK(machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); … … 1316 1225 ComPtr<ISerialPort> uart; 1317 1226 1318 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > SerialPortCount))1319 return errorSyntax(USAGE_MODIFYVM,1320 "Missing or Invalid Serial Port number in '%s'",1321 GetOptState.pDef->pszLong);1322 1323 1227 CHECK_ERROR_BREAK(machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 1324 1228 ASSERT(uart); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r24780 r25324 715 715 case 'e': // sataideemulation 716 716 { 717 if ((GetState.uIndex < 1) && (GetState.uIndex > 4))718 return errorSyntax(USAGE_STORAGECONTROLLER,719 "Missing or Invalid SATA boot slot number in '%s'",720 GetState.pDef->pszLong);721 722 if ((ValueUnion.u32 < 1) && (ValueUnion.u32 > 30))723 return errorSyntax(USAGE_STORAGECONTROLLER,724 "Missing or Invalid SATA port number in '%s'",725 GetState.pDef->pszLong);726 727 717 satabootdev = GetState.uIndex; 728 718 sataidedev = ValueUnion.u32;
Note:
See TracChangeset
for help on using the changeset viewer.