Changeset 32701 in vbox
- Timestamp:
- Sep 22, 2010 5:12:01 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r32536 r32701 132 132 void printUsageInternal(USAGECATEGORY u64Cmd) 133 133 { 134 RTPrintf("Usage: VBoxManage internalcommands <command> [command arguments]\n" 135 "\n" 136 "Commands:\n" 137 "\n" 138 "%s%s%s%s%s%s%s%s%s%s%s%s" 139 "WARNING: This is a development tool and shall only be used to analyse\n" 140 " problems. It is completely unsupported and will change in\n" 141 " incompatible ways without warning.\n", 142 143 (u64Cmd & USAGE_LOADSYMS) 144 ? " loadsyms <vmname>|<uuid> <symfile> [delta] [module] [module address]\n" 145 " This will instruct DBGF to load the given symbolfile\n" 146 " during initialization.\n" 147 "\n" 148 : "", 149 (u64Cmd & USAGE_UNLOADSYMS) 150 ? " unloadsyms <vmname>|<uuid> <symfile>\n" 151 " Removes <symfile> from the list of symbol files that\n" 152 " should be loaded during DBF initialization.\n" 153 "\n" 154 : "", 155 (u64Cmd & USAGE_SETHDUUID) 156 ? " sethduuid <filepath> [<uuid>]\n" 157 " Assigns a new UUID to the given image file. This way, multiple copies\n" 158 " of a container can be registered.\n" 159 "\n" 160 : "", 161 (u64Cmd & USAGE_SETHDPARENTUUID) 162 ? " sethdparentuuid <filepath> <uuid>\n" 163 " Assigns a new parent UUID to the given image file.\n" 164 "\n" 165 : "", 166 (u64Cmd & USAGE_DUMPHDINFO) 167 ? " dumphdinfo <filepath>\n" 168 " Prints information about the image at the given location.\n" 169 "\n" 170 : "", 171 (u64Cmd & USAGE_LISTPARTITIONS) 172 ? " listpartitions -rawdisk <diskname>\n" 173 " Lists all partitions on <diskname>.\n" 174 "\n" 175 : "", 176 (u64Cmd & USAGE_CREATERAWVMDK) 177 ? " createrawvmdk -filename <filename> -rawdisk <diskname>\n" 178 " [-partitions <list of partition numbers> [-mbr <filename>] ]\n" 179 " [-register] [-relative]\n" 180 " Creates a new VMDK image which gives access to an entite host disk (if\n" 181 " the parameter -partitions is not specified) or some partitions of a\n" 182 " host disk. If access to individual partitions is granted, then the\n" 183 " parameter -mbr can be used to specify an alternative MBR to be used\n" 184 " (the partitioning information in the MBR file is ignored).\n" 185 " The diskname is on Linux e.g. /dev/sda, and on Windows e.g.\n" 186 " \\\\.\\PhysicalDrive0).\n" 187 " On Linux host the parameter -relative causes a VMDK file to be created\n" 188 " which refers to individual partitions instead to the entire disk.\n" 189 " Optionally the created image can be immediately registered.\n" 190 " The necessary partition numbers can be queried with\n" 191 " VBoxManage internalcommands listpartitions\n" 192 "\n" 193 : "", 194 (u64Cmd & USAGE_RENAMEVMDK) 195 ? " renamevmdk -from <filename> -to <filename>\n" 196 " Renames an existing VMDK image, including the base file and all its extents.\n" 197 "\n" 198 : "", 199 (u64Cmd & USAGE_CONVERTTORAW) 200 ? " converttoraw [-format <fileformat>] <filename> <outputfile>" 134 RTStrmPrintf(g_pStdErr, 135 "Usage: VBoxManage internalcommands <command> [command arguments]\n" 136 "\n" 137 "Commands:\n" 138 "\n" 139 "%s%s%s%s%s%s%s%s%s%s%s%s" 140 "WARNING: This is a development tool and shall only be used to analyse\n" 141 " problems. It is completely unsupported and will change in\n" 142 " incompatible ways without warning.\n", 143 144 (u64Cmd & USAGE_LOADSYMS) 145 ? " loadsyms <vmname>|<uuid> <symfile> [delta] [module] [module address]\n" 146 " This will instruct DBGF to load the given symbolfile\n" 147 " during initialization.\n" 148 "\n" 149 : "", 150 (u64Cmd & USAGE_UNLOADSYMS) 151 ? " unloadsyms <vmname>|<uuid> <symfile>\n" 152 " Removes <symfile> from the list of symbol files that\n" 153 " should be loaded during DBF initialization.\n" 154 "\n" 155 : "", 156 (u64Cmd & USAGE_SETHDUUID) 157 ? " sethduuid <filepath> [<uuid>]\n" 158 " Assigns a new UUID to the given image file. This way, multiple copies\n" 159 " of a container can be registered.\n" 160 "\n" 161 : "", 162 (u64Cmd & USAGE_SETHDPARENTUUID) 163 ? " sethdparentuuid <filepath> <uuid>\n" 164 " Assigns a new parent UUID to the given image file.\n" 165 "\n" 166 : "", 167 (u64Cmd & USAGE_DUMPHDINFO) 168 ? " dumphdinfo <filepath>\n" 169 " Prints information about the image at the given location.\n" 170 "\n" 171 : "", 172 (u64Cmd & USAGE_LISTPARTITIONS) 173 ? " listpartitions -rawdisk <diskname>\n" 174 " Lists all partitions on <diskname>.\n" 175 "\n" 176 : "", 177 (u64Cmd & USAGE_CREATERAWVMDK) 178 ? " createrawvmdk -filename <filename> -rawdisk <diskname>\n" 179 " [-partitions <list of partition numbers> [-mbr <filename>] ]\n" 180 " [-register] [-relative]\n" 181 " Creates a new VMDK image which gives access to an entite host disk (if\n" 182 " the parameter -partitions is not specified) or some partitions of a\n" 183 " host disk. If access to individual partitions is granted, then the\n" 184 " parameter -mbr can be used to specify an alternative MBR to be used\n" 185 " (the partitioning information in the MBR file is ignored).\n" 186 " The diskname is on Linux e.g. /dev/sda, and on Windows e.g.\n" 187 " \\\\.\\PhysicalDrive0).\n" 188 " On Linux host the parameter -relative causes a VMDK file to be created\n" 189 " which refers to individual partitions instead to the entire disk.\n" 190 " Optionally the created image can be immediately registered.\n" 191 " The necessary partition numbers can be queried with\n" 192 " VBoxManage internalcommands listpartitions\n" 193 "\n" 194 : "", 195 (u64Cmd & USAGE_RENAMEVMDK) 196 ? " renamevmdk -from <filename> -to <filename>\n" 197 " Renames an existing VMDK image, including the base file and all its extents.\n" 198 "\n" 199 : "", 200 (u64Cmd & USAGE_CONVERTTORAW) 201 ? " converttoraw [-format <fileformat>] <filename> <outputfile>" 201 202 #ifdef ENABLE_CONVERT_RAW_TO_STDOUT 202 203 "|stdout" 203 204 #endif /* ENABLE_CONVERT_RAW_TO_STDOUT */ 204 205 205 "\n" 206 " Convert image to raw, writing to file" 206 207 #ifdef ENABLE_CONVERT_RAW_TO_STDOUT 207 208 " or stdout" 208 209 #endif /* ENABLE_CONVERT_RAW_TO_STDOUT */ 209 210 211 212 213 214 215 216 217 218 210 ".\n" 211 "\n" 212 : "", 213 (u64Cmd & USAGE_CONVERTHD) 214 ? " converthd [-srcformat VDI|VMDK|VHD|RAW]\n" 215 " [-dstformat VDI|VMDK|VHD|RAW]\n" 216 " <inputfile> <outputfile>\n" 217 " converts hard disk images between formats\n" 218 "\n" 219 : "", 219 220 #ifdef RT_OS_WINDOWS 220 221 222 223 224 225 226 227 228 229 221 (u64Cmd & USAGE_MODINSTALL) 222 ? " modinstall\n" 223 " Installs the neccessary driver for the host OS\n" 224 "\n" 225 : "", 226 (u64Cmd & USAGE_MODUNINSTALL) 227 ? " moduninstall\n" 228 " Deinstalls the driver\n" 229 "\n" 230 : "", 230 231 #else 231 232 232 "", 233 "", 233 234 #endif 234 235 236 237 238 239 240 235 (u64Cmd & USAGE_DEBUGLOG) 236 ? " debuglog <vmname>|<uuid> [--enable|--disable] [--flags todo]\n" 237 " [--groups todo] [--destinations todo]\n" 238 " Controls debug logging.\n" 239 "\n" 240 : "" 241 ); 241 242 } 242 243 … … 292 293 } 293 294 } 294 RT Printf("Error: Cannot find unique key for '%s'!\n", pszKeyBase);295 RTMsgError("Cannot find unique key for '%s'!", pszKeyBase); 295 296 return E_FAIL; 296 297 } … … 355 356 } 356 357 else 357 RT Printf("error: failed to delete key '%s' from '%s', string conversion error %Rrc!\n",358 pszKey, pszKeyBase, rc);358 RTMsgError("Failed to delete key '%s' from '%s', string conversion error %Rrc!", 359 pszKey, pszKeyBase, rc); 359 360 360 361 return E_FAIL; … … 377 378 HRESULT hrc = pMachine->SetExtraData(Bstr(Utf8StrFmt("%s/%s/%s", pszKeyBase, pszKey, pszAttribute)), Bstr(pszValue)); 378 379 if (FAILED(hrc)) 379 RT Printf("error: Failed to set '%s/%s/%s' to '%s'! hrc=%#x\n",380 pszKeyBase, pszKey, pszAttribute, pszValue, hrc);380 RTMsgError("Failed to set '%s/%s/%s' to '%s'! hrc=%#x", 381 pszKeyBase, pszKey, pszAttribute, pszValue, hrc); 381 382 return hrc; 382 383 } … … 502 503 static DECLCALLBACK(void) handleVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) 503 504 { 504 RTPrintf("ERROR: "); 505 RTPrintfV(pszFormat, va); 506 RTPrintf("\n"); 507 RTPrintf("Error code %Rrc at %s(%u) in function %s\n", rc, RT_SRC_POS_ARGS); 505 RTMsgErrorV(pszFormat, va); 506 RTMsgError("Error code %Rrc at %s(%u) in function %s", rc, RT_SRC_POS_ARGS); 508 507 } 509 508 … … 555 554 if (RT_FAILURE(rc)) 556 555 { 557 RT Printf("Format autodetect failed: %Rrc\n", rc);556 RTMsgError("Format autodetect failed: %Rrc", rc); 558 557 return 1; 559 558 } … … 576 575 if (RT_FAILURE(rc)) 577 576 { 578 RT Printf("Error while creating the virtual disk container: %Rrc\n", rc);577 RTMsgError("Cannot create the virtual disk container: %Rrc", rc); 579 578 return 1; 580 579 } … … 584 583 if (RT_FAILURE(rc)) 585 584 { 586 RT Printf("Error while opening the image: %Rrc\n", rc);585 RTMsgError("Cannot open the image: %Rrc", rc); 587 586 return 1; 588 587 } … … 593 592 rc = VDSetParentUuid(pDisk, VD_LAST_IMAGE, uuid.raw()); 594 593 if (RT_FAILURE(rc)) 595 RT Printf("Error while setting a new UUID: %Rrc\n", rc);594 RTMsgError("Cannot set a new UUID: %Rrc", rc); 596 595 else 597 596 RTPrintf("UUID changed to: %s\n", uuid.toString().c_str()); … … 617 616 if (RT_FAILURE(rc)) 618 617 { 619 RT Printf("Format autodetect failed: %Rrc\n", rc);618 RTMsgError("Format autodetect failed: %Rrc", rc); 620 619 return 1; 621 620 } … … 638 637 if (RT_FAILURE(rc)) 639 638 { 640 RT Printf("Error while creating the virtual disk container: %Rrc\n", rc);639 RTMsgError("Cannot create the virtual disk container: %Rrc", rc); 641 640 return 1; 642 641 } … … 646 645 if (RT_FAILURE(rc)) 647 646 { 648 RT Printf("Error while opening the image: %Rrc\n", rc);647 RTMsgError("Cannot open the image: %Rrc", rc); 649 648 return 1; 650 649 } … … 697 696 else 698 697 { 699 RT Printf("More than one extended partition. Aborting\n");698 RTMsgError("More than one extended partition"); 700 699 return VERR_INVALID_PARAMETER; 701 700 } … … 710 709 if (!uStart) 711 710 { 712 RT Printf("Inconsistency for logical partition start. Aborting\n");711 RTMsgError("Inconsistency for logical partition start"); 713 712 return VERR_INVALID_PARAMETER; 714 713 } … … 722 721 if (aBuffer[510] != 0x55 || aBuffer[511] != 0xaa) 723 722 { 724 RT Printf("Logical partition without magic. Aborting\n");723 RTMsgError("Logical partition without magic"); 725 724 return VERR_INVALID_PARAMETER; 726 725 } … … 729 728 if (p[4] == 0) 730 729 { 731 RT Printf("Logical partition with type 0 encountered. Aborting\n");730 RTMsgError("Logical partition with type 0 encountered"); 732 731 return VERR_INVALID_PARAMETER; 733 732 } … … 745 744 if (!uStartOffset) 746 745 { 747 RT Printf("Invalid partition start offset. Aborting\n");746 RTMsgError("Invalid partition start offset"); 748 747 return VERR_INVALID_PARAMETER; 749 748 } … … 763 762 else 764 763 { 765 RT Printf("Logical partition chain broken. Aborting\n");764 RTMsgError("Logical partition chain broken"); 766 765 return VERR_INVALID_PARAMETER; 767 766 } … … 784 783 else if (pPart->aPartitions[j].uStart == uMinVal) 785 784 { 786 RT Printf("Two partitions start at the same place. Aborting\n");785 RTMsgError("Two partitions start at the same place"); 787 786 return VERR_INVALID_PARAMETER; 788 787 } 789 788 else if (pPart->aPartitions[j].uStart == 0) 790 789 { 791 RT Printf("Partition starts at sector 0. Aborting\n");790 RTMsgError("Partition starts at sector 0"); 792 791 return VERR_INVALID_PARAMETER; 793 792 } … … 818 817 if (pPart->aPartitions[i].uStart < uPrevEnd) 819 818 { 820 RT Printf("Overlapping partitions. Aborting\n");819 RTMsgError("Overlapping partitions"); 821 820 return VERR_INVALID_PARAMETER; 822 821 } … … 857 856 if (RT_FAILURE(vrc)) 858 857 { 859 RT Printf("Error opening the raw disk: %Rrc\n", vrc);858 RTMsgError("Cannnot open the raw disk: %Rrc", vrc); 860 859 return vrc; 861 860 } … … 987 986 if (RT_FAILURE(vrc)) 988 987 { 989 RT Printf("Error opening the raw disk '%s': %Rrc\n", rawdisk.c_str(), vrc);988 RTMsgError("Cannot open the raw disk '%s': %Rrc", rawdisk.c_str(), vrc); 990 989 goto out; 991 990 } … … 1016 1015 else 1017 1016 { 1018 RT Printf("File '%s' is no fixed/removable medium device\n", rawdisk.c_str());1017 RTMsgError("File '%s' is no fixed/removable medium device", rawdisk.c_str()); 1019 1018 vrc = VERR_INVALID_PARAMETER; 1020 1019 goto out; … … 1034 1033 { 1035 1034 vrc = RTErrConvertFromWin32(GetLastError()); 1036 RT Printf("Error getting the geometry of the raw disk '%s': %Rrc\n", rawdisk.c_str(), vrc);1035 RTMsgError("Cannot get the geometry of the raw disk '%s': %Rrc", rawdisk.c_str(), vrc); 1037 1036 goto out; 1038 1037 } … … 1062 1061 { 1063 1062 vrc = RTErrConvertFromErrno(errno); 1064 RT Printf("Error getting the size of the raw disk '%s': %Rrc\n", rawdisk.c_str(), vrc);1063 RTMsgError("Cannot get the size of the raw disk '%s': %Rrc", rawdisk.c_str(), vrc); 1065 1064 goto out; 1066 1065 } … … 1069 1068 else 1070 1069 { 1071 RT Printf("File '%s' is no block device\n", rawdisk.c_str());1070 RTMsgError("File '%s' is no block device", rawdisk.c_str()); 1072 1071 vrc = VERR_INVALID_PARAMETER; 1073 1072 goto out; … … 1085 1084 else 1086 1085 { 1087 RT Printf("Cannot get the block size for file '%s': %Rrc", rawdisk.c_str(), vrc);1086 RTMsgError("Cannot get the block size for file '%s': %Rrc", rawdisk.c_str(), vrc); 1088 1087 vrc = RTErrConvertFromErrno(errno); 1089 1088 goto out; … … 1093 1092 { 1094 1093 vrc = RTErrConvertFromErrno(errno); 1095 RT Printf("Cannot get the block count for file '%s': %Rrc", rawdisk.c_str(), vrc);1094 RTMsgError("Cannot get the block count for file '%s': %Rrc", rawdisk.c_str(), vrc); 1096 1095 goto out; 1097 1096 } … … 1099 1098 else 1100 1099 { 1101 RT Printf("File '%s' is no block device\n", rawdisk.c_str());1100 RTMsgError("File '%s' is no block device", rawdisk.c_str()); 1102 1101 vrc = VERR_INVALID_PARAMETER; 1103 1102 goto out; … … 1114 1113 { 1115 1114 vrc = RTErrConvertFromErrno(errno); 1116 RT Printf("Error getting the size of the raw disk '%s': %Rrc\n", rawdisk.c_str(), vrc);1115 RTMsgError("Cannot get the size of the raw disk '%s': %Rrc", rawdisk.c_str(), vrc); 1117 1116 goto out; 1118 1117 } … … 1120 1119 else 1121 1120 { 1122 RT Printf("File '%s' is no block or char device\n", rawdisk.c_str());1121 RTMsgError("File '%s' is no block or char device", rawdisk.c_str()); 1123 1122 vrc = VERR_INVALID_PARAMETER; 1124 1123 goto out; … … 1136 1135 { 1137 1136 vrc = RTErrConvertFromErrno(errno); 1138 RT Printf("Cannot get the block count for file '%s': %Rrc", rawdisk.c_str(), vrc);1137 RTMsgError("Cannot get the block count for file '%s': %Rrc", rawdisk.c_str(), vrc); 1139 1138 goto out; 1140 1139 } … … 1142 1141 else 1143 1142 { 1144 RT Printf("File '%s' is no character device\n", rawdisk.c_str());1143 RTMsgError("File '%s' is no character device", rawdisk.c_str()); 1145 1144 vrc = VERR_INVALID_PARAMETER; 1146 1145 goto out; … … 1152 1151 if (RT_FAILURE(vrc)) 1153 1152 { 1154 RT Printf("Error getting the size of the raw disk '%s': %Rrc\n", rawdisk.c_str(), vrc);1153 RTMsgError("Cannot get the size of the raw disk '%s': %Rrc", rawdisk.c_str(), vrc); 1155 1154 goto out; 1156 1155 } … … 1160 1159 if (!cbSize || cbSize % 512) 1161 1160 { 1162 RT Printf("Detected size of raw disk '%s' is %s, an invalid value\n", rawdisk.c_str(), cbSize);1161 RTMsgError("Detected size of raw disk '%s' is %s, an invalid value", rawdisk.c_str(), cbSize); 1163 1162 vrc = VERR_INVALID_PARAMETER; 1164 1163 goto out; … … 1191 1190 if (RT_FAILURE(vrc)) 1192 1191 { 1193 RT Printf("Incorrect value in partitions parameter\n");1192 RTMsgError("Incorrect value in partitions parameter"); 1194 1193 goto out; 1195 1194 } … … 1200 1199 else if (*p != '\0') 1201 1200 { 1202 RT Printf("Incorrect separator in partitions parameter\n");1201 RTMsgError("Incorrect separator in partitions parameter"); 1203 1202 vrc = VERR_INVALID_PARAMETER; 1204 1203 goto out; … … 1210 1209 if (RT_FAILURE(vrc)) 1211 1210 { 1212 RT Printf("Error reading the partition information from '%s'\n", rawdisk.c_str());1211 RTMsgError("Cannot read the partition information from '%s'", rawdisk.c_str()); 1213 1212 goto out; 1214 1213 } … … 1223 1222 * partitions error later during VMDK creation. So warn 1224 1223 * here and ignore what the user requested. */ 1225 RTPrintf("Warning: it is not possible (and necessary) to explicitly give access to the\n" 1226 " extended partition %u. If required, enable access to all logical\n" 1227 " partitions inside this extended partition.\n", partitions.aPartitions[i].uIndex); 1224 RTMsgWarning("It is not possible (and necessary) to explicitly give access to the " 1225 "extended partition %u. If required, enable access to all logical " 1226 "partitions inside this extended partition.", 1227 partitions.aPartitions[i].uIndex); 1228 1228 uPartitions &= ~RT_BIT(partitions.aPartitions[i].uIndex); 1229 1229 } … … 1241 1241 if (!pPartDesc) 1242 1242 { 1243 RT Printf("Out of memory allocating the partition list for '%s'\n", rawdisk.c_str());1243 RTMsgError("Out of memory allocating the partition list for '%s'", rawdisk.c_str()); 1244 1244 vrc = VERR_NO_MEMORY; 1245 1245 goto out; … … 1257 1257 if (!pPartData) 1258 1258 { 1259 RT Printf("Out of memory allocating the partition descriptor for '%s'\n", rawdisk.c_str());1259 RTMsgError("Out of memory allocating the partition descriptor for '%s'", rawdisk.c_str()); 1260 1260 vrc = VERR_NO_MEMORY; 1261 1261 goto out; … … 1265 1265 if (RT_FAILURE(vrc)) 1266 1266 { 1267 RT Printf("Cannot read partition data from raw device '%s': %Rrc\n", rawdisk.c_str(), vrc);1267 RTMsgError("Cannot read partition data from raw device '%s': %Rrc", rawdisk.c_str(), vrc); 1268 1268 goto out; 1269 1269 } … … 1276 1276 if (RT_FAILURE(vrc)) 1277 1277 { 1278 RT Printf("Cannot open replacement MBR file '%s' specified with -mbr: %Rrc\n", pszMBRFilename, vrc);1278 RTMsgError("Cannot open replacement MBR file '%s' specified with -mbr: %Rrc", pszMBRFilename, vrc); 1279 1279 goto out; 1280 1280 } … … 1283 1283 if (RT_FAILURE(vrc)) 1284 1284 { 1285 RT Printf("Cannot read replacement MBR file '%s': %Rrc\n", pszMBRFilename, vrc);1285 RTMsgError("Cannot read replacement MBR file '%s': %Rrc", pszMBRFilename, vrc); 1286 1286 goto out; 1287 1287 } … … 1306 1306 if (!pPartDesc) 1307 1307 { 1308 RT Printf("Out of memory allocating the partition list for '%s'\n", rawdisk.c_str());1308 RTMsgError("Out of memory allocating the partition list for '%s'", rawdisk.c_str()); 1309 1309 vrc = VERR_NO_MEMORY; 1310 1310 goto out; … … 1322 1322 if (RT_FAILURE(vrc)) 1323 1323 { 1324 RT Printf("Error creating reference to individual partition %u, rc=%Rrc\n",1324 RTMsgError("Cannot create reference to individual partition %u, rc=%Rrc", 1325 1325 partitions.aPartitions[i].uIndex, vrc); 1326 1326 goto out; … … 1335 1335 if (RT_FAILURE(vrc)) 1336 1336 { 1337 RT Printf("Error creating reference to individual partition %u, rc=%Rrc\n",1337 RTMsgError("Cannot create reference to individual partition %u, rc=%Rrc", 1338 1338 partitions.aPartitions[i].uIndex, vrc); 1339 1339 goto out; … … 1392 1392 if (!RawDescriptor.pPartDescs[i].cbData) 1393 1393 { 1394 RT Printf("MBR/EPT overlaps with data area\n");1394 RTMsgError("MBR/EPT overlaps with data area"); 1395 1395 vrc = VERR_INVALID_PARAMETER; 1396 1396 goto out; … … 1429 1429 if (RT_FAILURE(vrc)) 1430 1430 { 1431 RT Printf("Error while creating the virtual disk container: %Rrc\n", vrc);1431 RTMsgError("Cannot create the virtual disk container: %Rrc", vrc); 1432 1432 goto out; 1433 1433 } … … 1448 1448 if (RT_FAILURE(vrc)) 1449 1449 { 1450 RT Printf("Error while creating the raw disk VMDK: %Rrc\n", vrc);1450 RTMsgError("Cannot create the raw disk VMDK: %Rrc", vrc); 1451 1451 goto out; 1452 1452 } … … 1479 1479 1480 1480 out: 1481 RT Printf("The raw disk vmdk file was not created\n");1481 RTMsgError("The raw disk vmdk file was not created"); 1482 1482 return RT_SUCCESS(vrc) ? 0 : 1; 1483 1483 } … … 1536 1536 if (RT_FAILURE(vrc)) 1537 1537 { 1538 RT Printf("Error while creating the virtual disk container: %Rrc\n", vrc);1538 RTMsgError("Cannot create the virtual disk container: %Rrc", vrc); 1539 1539 return vrc; 1540 1540 } … … 1544 1544 if (RT_FAILURE(vrc)) 1545 1545 { 1546 RT Printf("Error while opening the source image: %Rrc\n", vrc);1546 RTMsgError("Cannot create the source image: %Rrc", vrc); 1547 1547 } 1548 1548 else … … 1551 1551 if (RT_FAILURE(vrc)) 1552 1552 { 1553 RT Printf("Error while renaming the image: %Rrc\n", vrc);1553 RTMsgError("Cannot rename the image: %Rrc", vrc); 1554 1554 } 1555 1555 } … … 1618 1618 if (RT_FAILURE(vrc)) 1619 1619 { 1620 RT Printf("Error while creating the virtual disk container: %Rrc\n", vrc);1620 RTMsgError("Cannot create the virtual disk container: %Rrc", vrc); 1621 1621 return 1; 1622 1622 } … … 1632 1632 { 1633 1633 VDCloseAll(pDisk); 1634 RT Printf("Error while creating destination file \"%s\": %Rrc\n", dst.c_str(), vrc);1634 RTMsgError("Cannot create destination file \"%s\": %Rrc", dst.c_str(), vrc); 1635 1635 return 1; 1636 1636 } … … 1649 1649 RTFileDelete(dst.c_str()); 1650 1650 } 1651 RT Printf("No file format specified and autodetect failed - please specify format: %Rrc\n", vrc);1651 RTMsgError("No file format specified and autodetect failed - please specify format: %Rrc", vrc); 1652 1652 return 1; 1653 1653 } … … 1664 1664 RTFileDelete(dst.c_str()); 1665 1665 } 1666 RT Printf("Error while opening the source image: %Rrc\n", vrc);1666 RTMsgError("Cannot open the source image: %Rrc", vrc); 1667 1667 return 1; 1668 1668 } … … 1675 1675 if (pvBuf) 1676 1676 { 1677 RT Printf("Converting image \"%s\" with size %RU64 bytes (%RU64MB) to raw...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M);1677 RTStrmPrintf(g_pStdErr, "Converting image \"%s\" with size %RU64 bytes (%RU64MB) to raw...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M); 1678 1678 while (offFile < cbSize) 1679 1679 { … … 1695 1695 RTFileDelete(dst.c_str()); 1696 1696 } 1697 RT Printf("Error copying image data: %Rrc\n", vrc);1697 RTMsgError("Cannot copy image data: %Rrc", vrc); 1698 1698 return 1; 1699 1699 } … … 1708 1708 RTFileDelete(dst.c_str()); 1709 1709 } 1710 RT Printf("Error allocating read buffer: %Rrc\n", vrc);1710 RTMsgError("Out of memory allocating read buffer"); 1711 1711 return 1; 1712 1712 } … … 1791 1791 if (RT_FAILURE(vrc)) 1792 1792 { 1793 RT Printf("No file format specified and autodetect failed - please specify format: %Rrc\n", vrc);1793 RTMsgError("No file format specified and autodetect failed - please specify format: %Rrc", vrc); 1794 1794 break; 1795 1795 } … … 1801 1801 if (RT_FAILURE(vrc)) 1802 1802 { 1803 RT Printf("Error while creating the source virtual disk container: %Rrc\n", vrc);1803 RTMsgError("Cannot create the source virtual disk container: %Rrc", vrc); 1804 1804 break; 1805 1805 } … … 1809 1809 if (RT_FAILURE(vrc)) 1810 1810 { 1811 RT Printf("Error while opening the source image: %Rrc\n", vrc);1811 RTMsgError("Cannot open the source image: %Rrc", vrc); 1812 1812 break; 1813 1813 } … … 1820 1820 if (RT_FAILURE(vrc)) 1821 1821 { 1822 RT Printf("Error while creating the destination virtual disk container: %Rrc\n", vrc);1822 RTMsgError("Cannot create the destination virtual disk container: %Rrc", vrc); 1823 1823 break; 1824 1824 } 1825 1825 1826 1826 uint64_t cbSize = VDGetSize(pSrcDisk, VD_LAST_IMAGE); 1827 RT Printf("Converting image \"%s\" with size %RU64 bytes (%RU64MB)...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M);1827 RTStrmPrintf(g_pStdErr, "Converting image \"%s\" with size %RU64 bytes (%RU64MB)...\n", src.c_str(), cbSize, (cbSize + _1M - 1) / _1M); 1828 1828 1829 1829 /* Create the output image */ … … 1833 1833 if (RT_FAILURE(vrc)) 1834 1834 { 1835 RT Printf("Error while copying the image: %Rrc\n", vrc);1835 RTMsgError("Cannot copy the image: %Rrc", vrc); 1836 1836 break; 1837 1837 } … … 1987 1987 /** @todo flags, groups destination. */ 1988 1988 if (fFlagsPresent || fGroupsPresent || fDestsPresent) 1989 RT Printf("WARNING: One or more of the requested features are not implemented! Feel free to do this... :-)\n");1989 RTMsgWarning("One or more of the requested features are not implemented! Feel free to do this."); 1990 1990 1991 1991 if (fEnablePresent && fEnable) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r32686 r32701 30 30 31 31 # include <VBox/com/VirtualBox.h> 32 33 # include <vector>34 # include <list>35 32 #endif /* !VBOX_ONLY_DOCS */ 36 33 … … 95 92 if (!g_fDetailedProgress) 96 93 { 97 RT Printf("0%%...");98 RTStrmFlush(g_pStd Out);94 RTStrmPrintf(g_pStdErr, "0%%..."); 95 RTStrmFlush(g_pStdErr); 99 96 } 100 97 … … 137 134 progress->COMGETTER(TimeRemaining)(&lSecsRem); 138 135 139 RT Printf("(%ld/%ld) %ls %ld%% => %ld%% (%d s remaining)\n", ulOperation + 1, cOperations, bstrOperationDescription.raw(), ulCurrentOperationPercent, ulCurrentPercent, lSecsRem);136 RTStrmPrintf(g_pStdErr, "(%ld/%ld) %ls %ld%% => %ld%% (%d s remaining)\n", ulOperation + 1, cOperations, bstrOperationDescription.raw(), ulCurrentOperationPercent, ulCurrentPercent, lSecsRem); 140 137 ulLastPercent = ulCurrentPercent; 141 138 ulLastOperationPercent = ulCurrentOperationPercent; … … 152 149 if (curVal < 100) 153 150 { 154 RT Printf("%ld%%...", curVal);155 RTStrmFlush(g_pStd Out);151 RTStrmPrintf(g_pStdErr, "%ld%%...", curVal); 152 RTStrmFlush(g_pStdErr); 156 153 } 157 154 } … … 190 187 { 191 188 if (SUCCEEDED(iRc)) 192 RT Printf("100%%\n");189 RTStrmPrintf(g_pStdErr, "100%%\n"); 193 190 else if (g_fCanceled) 194 RT Printf("CANCELED\n");191 RTStrmPrintf(g_pStdErr, "CANCELED\n"); 195 192 else 196 RT Printf("FAILED\n");193 RTStrmPrintf(g_pStdErr, "FAILED\n"); 197 194 } 198 195 else 199 RT Printf("\n");200 RTStrmFlush(g_pStd Out);196 RTStrmPrintf(g_pStdErr, "\n"); 197 RTStrmFlush(g_pStdErr); 201 198 return iRc; 202 199 } … … 279 276 if (FAILED(rc)) 280 277 { 281 RT Printf("ERROR: failed to initialize COM!\n");278 RTMsgError("Failed to initialize COM!"); 282 279 return rc; 283 280 } … … 318 315 rc = virtualBox.createLocalObject(CLSID_VirtualBox); 319 316 if (FAILED(rc)) 320 RT Printf("ERROR: failed to create the VirtualBox object!\n");317 RTMsgError("Failed to create the VirtualBox object!"); 321 318 else 322 319 { 323 320 rc = session.createInprocObject(CLSID_Session); 324 321 if (FAILED(rc)) 325 RT Printf("ERROR: failed to create a session object!\n");322 RTMsgError("Failed to create a session object!"); 326 323 } 327 324 … … 332 329 { 333 330 com::GluePrintRCMessage(rc); 334 RT Printf("Most likely, the VirtualBox COM server is not running or failed to start.\n");331 RTMsgError("Most likely, the VirtualBox COM server is not running or failed to start."); 335 332 } 336 333 else -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r31461 r32701 27 27 28 28 #include <iprt/types.h> 29 #include <iprt/message.h> 29 30 30 31 //////////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r31539 r32701 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxManage - VirtualBox's command-line interface.3 * VBoxManage - Implementation of controlvm command. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 39 39 40 40 #include "VBoxManage.h" 41 42 #include <list> 41 43 42 44 … … 148 150 com::ProgressErrorInfo info(progress); 149 151 if (info.isBasicAvailable()) 150 { 151 RTPrintf("Error: failed to power off machine. Error message: %lS\n", info.getText().raw()); 152 } 153 else 154 { 155 RTPrintf("Error: failed to power off machine. No error message available!\n"); 156 } 152 RTMsgError("Failed to power off machine. Error message: %lS", info.getText().raw()); 153 else 154 RTMsgError("Failed to power off machine. No error message available!"); 157 155 } 158 156 } … … 175 173 com::ProgressErrorInfo info(progress); 176 174 if (info.isBasicAvailable()) 177 { 178 RTPrintf("Error: failed to save machine state. Error message: %lS\n", info.getText().raw()); 179 } 180 else 181 { 182 RTPrintf("Error: failed to save machine state. No error message available!\n"); 183 } 175 RTMsgError("Failed to save machine state. Error message: %lS", info.getText().raw()); 176 else 177 RTMsgError("Failed to save machine state. No error message available!"); 184 178 console->Resume(); 185 179 } … … 212 206 } 213 207 214 /* Arbitrary restrict the length of a sequence of scancodes to 1024. */ 215 LONG alScancodes[1024]; 216 int cScancodes = 0; 208 std::list<LONG> llScancodes; 217 209 218 210 /* Process the command line. */ 219 211 int i; 220 for (i = 1 + 1; i < a->argc && cScancodes < (int)RT_ELEMENTS(alScancodes); i++, cScancodes++)212 for (i = 1 + 1; i < a->argc; i++) 221 213 { 222 214 if ( RT_C_IS_XDIGIT (a->argv[i][0]) … … 228 220 if (RT_FAILURE (irc)) 229 221 { 230 RT Printf("Error: converting '%s' returned %Rrc!\n", a->argv[i], rc);222 RTMsgError("Converting '%s' returned %Rrc!", a->argv[i], rc); 231 223 rc = E_FAIL; 232 224 break; 233 225 } 234 226 235 alScancodes[cScancodes] = u8Scancode;236 } 237 else 238 { 239 RT Printf("Error: '%s' is not a hex byte!\n", a->argv[i]);227 llScancodes.push_back(u8Scancode); 228 } 229 else 230 { 231 RTMsgError("Error: '%s' is not a hex byte!", a->argv[i]); 240 232 rc = E_FAIL; 241 233 break; … … 246 238 break; 247 239 248 if ( cScancodes == RT_ELEMENTS(alScancodes) 249 && i < a->argc) 250 { 251 RTPrintf("Error: too many scancodes, maximum %d allowed!\n", RT_ELEMENTS(alScancodes)); 252 rc = E_FAIL; 253 break; 254 } 255 256 /* Send scancodes to the VM. 257 * Note: 'PutScancodes' did not work here. Only the first scancode was transmitted. 258 */ 259 for (i = 0; i < cScancodes; i++) 260 { 261 CHECK_ERROR_BREAK(keyboard, PutScancode(alScancodes[i])); 262 RTPrintf("Scancode[%d]: 0x%02X\n", i, alScancodes[i]); 240 /* Send scancodes to the VM. */ 241 com::SafeArray<LONG> saScancodes(llScancodes); 242 ULONG codesStored = 0; 243 CHECK_ERROR_BREAK(keyboard, PutScancodes(ComSafeArrayAsInParam(saScancodes), 244 &codesStored)); 245 if (codesStored < saScancodes.size()) 246 { 247 RTMsgError("Only %d scancodes were stored", codesStored); 248 rc = E_FAIL; 249 break; 263 250 } 264 251 } … … 352 339 } 353 340 else 354 { 355 RTPrintf("The NIC %d is currently disabled and thus can't change its tracefile\n", n); 356 } 341 RTMsgError("The NIC %d is currently disabled and thus can't change its tracefile", n); 357 342 } 358 343 } … … 403 388 } 404 389 else 405 { 406 RTPrintf("The NIC %d is currently disabled and thus can't change its tracefile\n", n); 407 } 390 RTMsgError("The NIC %d is currently disabled and thus can't change its trace flag", n); 408 391 } 409 392 } … … 497 480 } 498 481 else 499 { 500 RTPrintf("The NIC %d is currently disabled and thus can't change its attachment type\n", n); 501 } 482 RTMsgError("The NIC %d is currently disabled and thus can't change its attachment type", n); 502 483 } 503 484 } … … 869 850 com::ProgressErrorInfo info(progress); 870 851 if (info.isBasicAvailable()) 871 RT Printf("Error: teleportation failed. Error message: %lS\n", info.getText().raw());872 else 873 RT Printf("Error: teleportation failed. No error message available!\n");852 RTMsgError("Teleportation failed. Error message: %lS", info.getText().raw()); 853 else 854 RTMsgError("Teleportation failed. No error message available!"); 874 855 } 875 856 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
r31539 r32701 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 28 28 #include <VBox/com/VirtualBox.h> 29 30 #include <vector>31 #include <list>32 29 #endif /* !VBOX_ONLY_DOCS */ 33 30 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r32536 r32701 48 48 static DECLCALLBACK(void) handleVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) 49 49 { 50 RTPrintf("ERROR: "); 51 RTPrintfV(pszFormat, va); 52 RTPrintf("\n"); 53 RTPrintf("Error code %Rrc at %s(%u) in function %s\n", rc, RT_SRC_POS_ARGS); 50 RTMsgError(pszFormat, va); 51 RTMsgError("Error code %Rrc at %s(%u) in function %s", rc, RT_SRC_POS_ARGS); 54 52 } 55 53 … … 300 298 com::ProgressErrorInfo info(progress); 301 299 if (info.isBasicAvailable()) 302 RT Printf("Error: failed to create hard disk. Error message: %lS\n", info.getText().raw());303 else 304 RT Printf("Error: failed to create hard disk. No error message available!\n");300 RTMsgError("Failed to create hard disk. Error message: %lS", info.getText().raw()); 301 else 302 RTMsgError("Failed to create hard disk. No error message available!"); 305 303 } 306 304 else … … 327 325 return SUCCEEDED(rc) ? 0 : 1; 328 326 } 329 330 #if 0 /* disabled until disk shrinking is implemented based on VBoxHDD */331 static DECLCALLBACK(int) hardDiskProgressCallback(PVM pVM, unsigned uPercent, void *pvUser)332 {333 unsigned *pPercent = (unsigned *)pvUser;334 335 if (*pPercent != uPercent)336 {337 *pPercent = uPercent;338 RTPrintf(".");339 if ((uPercent % 10) == 0 && uPercent)340 RTPrintf("%d%%", uPercent);341 RTStrmFlush(g_pStdOut);342 }343 344 return VINF_SUCCESS;345 }346 #endif347 327 348 328 static const RTGETOPTDEF g_aModifyHardDiskOptions[] = … … 474 454 if (RT_FAILURE(irc)) 475 455 { 476 RT Printf("Cannot convert filename \"%s\" to absolute path\n", FilenameOrUuid);456 RTMsgError("Cannot convert filename \"%s\" to absolute path", FilenameOrUuid); 477 457 return 1; 478 458 } … … 489 469 { 490 470 if (rc == E_NOTIMPL) 491 { 492 RTPrintf("Error: Compact hard disk operation is not implemented!\n"); 493 RTPrintf("The functionality will be restored later.\n"); 494 } 471 RTMsgError("Compact hard disk operation is not implemented!"); 495 472 else if (rc == VBOX_E_NOT_SUPPORTED) 496 { 497 RTPrintf("Error: Compact hard disk operation for this format is not implemented yet!\n"); 498 } 473 RTMsgError("Compact hard disk operation for this format is not implemented yet!"); 499 474 else 500 475 com::GluePrintRCMessage(rc); … … 519 494 if (RT_FAILURE(irc)) 520 495 { 521 RT Printf("Cannot convert filename \"%s\" to absolute path\n", FilenameOrUuid);496 RTMsgError("Cannot convert filename \"%s\" to absolute path", FilenameOrUuid); 522 497 return 1; 523 498 } … … 534 509 { 535 510 if (rc == E_NOTIMPL) 536 { 537 RTPrintf("Error: Resize hard disk operation is not implemented!\n"); 538 RTPrintf("The functionality will be restored later.\n"); 539 } 511 RTMsgError("Resize hard disk operation is not implemented!"); 540 512 else if (rc == VBOX_E_NOT_SUPPORTED) 541 { 542 RTPrintf("Error: Resize hard disk operation for this format is not implemented yet!\n"); 543 } 513 RTMsgError("Resize hard disk operation for this format is not implemented yet!"); 544 514 else 545 515 com::GluePrintRCMessage(rc); … … 674 644 if (RT_FAILURE(irc)) 675 645 { 676 RT Printf("Cannot convert filename \"%s\" to absolute path\n", Utf8Str(src).c_str());646 RTMsgError("Cannot convert filename \"%s\" to absolute path", Utf8Str(src).c_str()); 677 647 return 1; 678 648 } … … 702 672 if (RT_FAILURE(irc)) 703 673 { 704 RT Printf("Cannot convert filename \"%s\" to absolute path\n", Utf8Str(dst).c_str());674 RTMsgError("Cannot convert filename \"%s\" to absolute path", Utf8Str(dst).c_str()); 705 675 return 1; 706 676 } … … 736 706 com::ProgressErrorInfo info(progress); 737 707 if (info.isBasicAvailable()) 738 RT Printf("Error: failed to clone hard disk. Error message: %lS\n", info.getText().raw());708 RTMsgError("Failed to clone hard disk. Error message: %lS", info.getText().raw()); 739 709 else 740 RT Printf("Error: failed to clone hard disk. No error message available!\n");710 RTMsgError("Failed to clone hard disk. No error message available!"); 741 711 break; 742 712 } … … 837 807 if (!srcfilename || !dstfilename || (fReadFromStdIn && !filesize)) 838 808 return errorSyntax(USAGE_CONVERTFROMRAW, "Incorrect number of parameters"); 839 RT Printf("Converting from raw image file=\"%s\" to file=\"%s\"...\n",840 srcfilename, dstfilename);809 RTStrmPrintf(g_pStdErr, "Converting from raw image file=\"%s\" to file=\"%s\"...\n", 810 srcfilename, dstfilename); 841 811 842 812 PVBOXHDD pDisk = NULL; … … 862 832 if (RT_FAILURE(rc)) 863 833 { 864 RT Printf("File=\"%s\" open error: %Rrf\n", srcfilename, rc);834 RTMsgError("Cannot open file \"%s\": %Rrc", srcfilename, rc); 865 835 goto out; 866 836 } … … 874 844 if (RT_FAILURE(rc)) 875 845 { 876 RT Printf("Error getting image size for file \"%s\": %Rrc\n", srcfilename, rc);846 RTMsgError("Cannot get image size for file \"%s\": %Rrc", srcfilename, rc); 877 847 goto out; 878 848 } 879 849 880 RTPrintf("Creating %s image with size %RU64 bytes (%RU64MB)...\n", (uImageFlags & VD_IMAGE_FLAGS_FIXED) ? "fixed" : "dynamic", cbFile, (cbFile + _1M - 1) / _1M); 850 RTStrmPrintf(g_pStdErr, "Creating %s image with size %RU64 bytes (%RU64MB)...\n", 851 (uImageFlags & VD_IMAGE_FLAGS_FIXED) ? "fixed" : "dynamic", cbFile, (cbFile + _1M - 1) / _1M); 881 852 char pszComment[256]; 882 853 RTStrPrintf(pszComment, sizeof(pszComment), "Converted image from %s", srcfilename); … … 884 855 if (RT_FAILURE(rc)) 885 856 { 886 RT Printf("Error while creating the virtual disk container: %Rrc\n", rc);857 RTMsgError("Cannot create the virtual disk container: %Rrc", rc); 887 858 goto out; 888 859 } … … 902 873 if (RT_FAILURE(rc)) 903 874 { 904 RT Printf("Error while creating the disk image \"%s\": %Rrc\n", dstfilename, rc);875 RTMsgError("Cannot create the disk image \"%s\": %Rrc", dstfilename, rc); 905 876 goto out; 906 877 } … … 912 883 { 913 884 rc = VERR_NO_MEMORY; 914 RT Printf("Not enough memory allocating buffers for image \"%s\": %Rrc\n", dstfilename, rc);885 RTMsgError("Out of memory allocating buffers for image \"%s\": %Rrc", dstfilename, rc); 915 886 goto out; 916 887 } … … 931 902 if (RT_FAILURE(rc)) 932 903 { 933 RT Printf("Failed to write to disk image \"%s\": %Rrc\n", dstfilename, rc);904 RTMsgError("Failed to write to disk image \"%s\": %Rrc", dstfilename, rc); 934 905 goto out; 935 906 } … … 1201 1172 if (RT_FAILURE(vrc)) 1202 1173 { 1203 RT Printf("Cannot convert filename \"%s\" to absolute path\n", FilenameOrUuid);1174 RTMsgError("Cannot convert filename \"%s\" to absolute path", FilenameOrUuid); 1204 1175 return 1; 1205 1176 } … … 1275 1246 hardDisk->COMGETTER(Format)(format.asOutParam()); 1276 1247 RTPrintf("Storage format: %lS\n", format.raw()); 1248 1249 /// @todo also dump config parameters (iSCSI) 1277 1250 1278 1251 if (!unknown) … … 1436 1409 if (RT_FAILURE(irc)) 1437 1410 { 1438 RT Printf("Cannot convert filename \"%s\" to absolute path\n", Filename);1411 RTMsgError("Cannot convert filename \"%s\" to absolute path", Filename); 1439 1412 return 1; 1440 1413 } … … 1571 1544 com::ProgressErrorInfo info(progress); 1572 1545 if (info.isBasicAvailable()) 1573 RT Printf("Error: failed to delete medium. Error message: %lS\n", info.getText().raw());1546 RTMsgError("Failed to delete medium. Error message: %lS", info.getText().raw()); 1574 1547 else 1575 RT Printf("Error: failed to delete medium. No error message available!\n");1548 RTMsgError("Failed to delete medium. No error message available!"); 1576 1549 } 1577 1550 } 1578 1551 else 1579 RT Printf("Error: failed to delete medium. Error code %Rrc\n", rc);1552 RTMsgError("Failed to delete medium. Error code %Rrc", rc); 1580 1553 } 1581 1554 CHECK_ERROR(medium, Close()); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r31539 r32701 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxManage - The 'guestcontrol'command.3 * VBoxManage - Implementation of guestcontrol command. 4 4 */ 5 5 … … 65 65 void usageGuestControl(void) 66 66 { 67 RTPrintf("VBoxManage guestcontrol execute <vmname>|<uuid>\n" 68 " <path to program>\n" 69 " --username <name> --password <password>\n" 70 " [--arguments \"<arguments>\"]\n" 71 " [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n" 72 " [--flags <flags>] [--timeout <msec>]\n" 73 " [--verbose] [--wait-for exit,stdout,stderr||]\n" 74 "\n"); 67 RTStrmPrintf(g_pStdErr, 68 "VBoxManage guestcontrol execute <vmname>|<uuid>\n" 69 " <path to program>\n" 70 " --username <name> --password <password>\n" 71 " [--arguments \"<arguments>\"]\n" 72 " [--environment \"<NAME>=<VALUE> [<NAME>=<VALUE>]\"]\n" 73 " [--flags <flags>] [--timeout <msec>]\n" 74 " [--verbose] [--wait-for exit,stdout,stderr||]\n" 75 "\n"); 75 76 } 76 77 … … 322 323 { 323 324 if (rc == VBOX_E_IPRT_ERROR) 324 RT Printf("%ls.\n", info.getText().raw());325 RTMsgError("%ls.", info.getText().raw()); 325 326 else 326 RT Printf("ERROR: %ls (%Rhrc).\n", info.getText().raw(), info.getResultCode());327 RTMsgError("%ls (%Rhrc).", info.getText().raw(), info.getResultCode()); 327 328 } 328 329 break; … … 392 393 { 393 394 if (rc == VBOX_E_IPRT_ERROR) 394 { 395 RTPrintf("%ls.\n", info.getText().raw()); 396 } 395 RTMsgError("%ls.", info.getText().raw()); 397 396 else 398 { 399 RTPrintf("ERROR: %ls (%Rhrc).\n", info.getText().raw(), info.getResultCode()); 400 } 397 RTMsgError("%ls (%Rhrc).", info.getText().raw(), info.getResultCode()); 401 398 } 402 399 cbOutputData = 0; … … 489 486 * because it contains more accurate info about what went wrong. */ 490 487 if (info.getResultCode() == VBOX_E_IPRT_ERROR) 491 { 492 RTPrintf("%ls.\n", info.getText().raw()); 493 } 488 RTMsgError("%ls.", info.getText().raw()); 494 489 else 495 490 { 496 RT Printf("\n\nProcess error details:\n");491 RTMsgError("Process error details:"); 497 492 GluePrintErrorInfo(info); 498 RTPrintf("\n");499 493 } 500 494 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r31698 r32701 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxManage - The 'guestproperty'command.3 * VBoxManage - Implementation of guestproperty command. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 51 51 void usageGuestProperty(void) 52 52 { 53 RTPrintf("VBoxManage guestproperty get <vmname>|<uuid>\n" 54 " <property> [--verbose]\n" 55 "\n"); 56 RTPrintf("VBoxManage guestproperty set <vmname>|<uuid>\n" 57 " <property> [<value> [--flags <flags>]]\n" 58 "\n"); 59 RTPrintf("VBoxManage guestproperty enumerate <vmname>|<uuid>\n" 60 " [--patterns <patterns>]\n" 61 "\n"); 62 RTPrintf("VBoxManage guestproperty wait <vmname>|<uuid> <patterns>\n" 63 " [--timeout <msec>] [--fail-on-timeout]\n" 64 "\n"); 53 RTStrmPrintf(g_pStdErr, 54 "VBoxManage guestproperty get <vmname>|<uuid>\n" 55 " <property> [--verbose]\n" 56 "\n"); 57 RTStrmPrintf(g_pStdErr, 58 "VBoxManage guestproperty set <vmname>|<uuid>\n" 59 " <property> [<value> [--flags <flags>]]\n" 60 "\n"); 61 RTStrmPrintf(g_pStdErr, 62 "VBoxManage guestproperty enumerate <vmname>|<uuid>\n" 63 " [--patterns <patterns>]\n" 64 "\n"); 65 RTStrmPrintf(g_pStdErr, 66 "VBoxManage guestproperty wait <vmname>|<uuid> <patterns>\n" 67 " [--timeout <msec>] [--fail-on-timeout]\n" 68 "\n"); 65 69 } 66 70 … … 357 361 if (!fSignalled) 358 362 { 359 RT Printf("Time out or interruption while waiting for a notification.\n");363 RTMsgError("Time out or interruption while waiting for a notification."); 360 364 if (fFailOnTimeout) 361 365 rcRet = 2; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r32531 r32701 37 37 if (!s_fShown) 38 38 { 39 RT Printf(VBOX_PRODUCT" Command Line Management Interface Version "40 VBOX_VERSION_STRING"\n"41 "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n"42 "All rights reserved.\n"43 "\n");39 RTStrmPrintf(g_pStdErr, VBOX_PRODUCT " Command Line Management Interface Version " 40 VBOX_VERSION_STRING "\n" 41 "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n" 42 "All rights reserved.\n" 43 "\n"); 44 44 s_fShown = true; 45 45 } … … 98 98 } 99 99 100 RTPrintf("Usage:\n" 101 "\n"); 100 RTStrmPrintf(g_pStdErr, 101 "Usage:\n" 102 "\n"); 102 103 103 104 if (u64Cmd == USAGE_ALL) 104 105 { 105 RTPrintf("VBoxManage [-v|--version] print version number and exit\n" 106 "VBoxManage [-q|--nologo] ... suppress the logo\n" 107 "\n"); 106 RTStrmPrintf(g_pStdErr, 107 "VBoxManage [-v|--version] print version number and exit\n" 108 "VBoxManage [-q|--nologo] ... suppress the logo\n" 109 "\n"); 108 110 } 109 111 110 112 if (u64Cmd & USAGE_LIST) 111 113 { 112 RTPrintf("VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|\n" 114 RTStrmPrintf(g_pStdErr, 115 "VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|\n" 113 116 #if defined(VBOX_WITH_NETFLT) 114 " bridgedifs|hostonlyifs|dhcpservers|hostinfo|\n"117 " bridgedifs|hostonlyifs|dhcpservers|hostinfo|\n" 115 118 #else 116 " bridgedifs|dhcpservers|hostinfo|\n"117 #endif 118 " hostcpuids|hddbackends|hdds|dvds|floppies|\n"119 " usbhost|usbfilters|systemproperties\n"120 "\n");119 " bridgedifs|dhcpservers|hostinfo|\n" 120 #endif 121 " hostcpuids|hddbackends|hdds|dvds|floppies|\n" 122 " usbhost|usbfilters|systemproperties\n" 123 "\n"); 121 124 } 122 125 123 126 if (u64Cmd & USAGE_SHOWVMINFO) 124 127 { 125 RTPrintf("VBoxManage showvminfo <uuid>|<name> [--details] [--statistics]\n" 126 " [--machinereadable]\n" 127 "VBoxManage showvminfo <uuid>|<name> --log <idx>\n" 128 "\n"); 128 RTStrmPrintf(g_pStdErr, 129 "VBoxManage showvminfo <uuid>|<name> [--details] [--statistics]\n" 130 " [--machinereadable]\n" 131 "VBoxManage showvminfo <uuid>|<name> --log <idx>\n" 132 "\n"); 129 133 } 130 134 131 135 if (u64Cmd & USAGE_REGISTERVM) 132 136 { 133 RTPrintf("VBoxManage registervm <filename>\n" 134 "\n"); 137 RTStrmPrintf(g_pStdErr, 138 "VBoxManage registervm <filename>\n" 139 "\n"); 135 140 } 136 141 137 142 if (u64Cmd & USAGE_UNREGISTERVM) 138 143 { 139 RTPrintf("VBoxManage unregistervm <uuid>|<name> [--delete]\n" 140 "\n"); 144 RTStrmPrintf(g_pStdErr, 145 "VBoxManage unregistervm <uuid>|<name> [--delete]\n" 146 "\n"); 141 147 } 142 148 143 149 if (u64Cmd & USAGE_CREATEVM) 144 150 { 145 RTPrintf("VBoxManage createvm --name <name>\n" 146 " [--ostype <ostype>]\n" 147 " [--register]\n" 148 " [--basefolder <path> | --settingsfile <path>]\n" 149 " [--uuid <uuid>]\n" 150 "\n"); 151 RTStrmPrintf(g_pStdErr, 152 "VBoxManage createvm --name <name>\n" 153 " [--ostype <ostype>]\n" 154 " [--register]\n" 155 " [--basefolder <path> | --settingsfile <path>]\n" 156 " [--uuid <uuid>]\n" 157 "\n"); 151 158 } 152 159 153 160 if (u64Cmd & USAGE_MODIFYVM) 154 161 { 155 RTPrintf("VBoxManage modifyvm <uuid|name>\n" 156 " [--name <name>]\n" 157 " [--ostype <ostype>]\n" 158 " [--memory <memorysize in MB>]\n" 159 " [--pagefusion on|off]\n" 160 " [--vram <vramsize in MB>]\n" 161 " [--acpi on|off]\n" 162 " [--ioapic on|off]\n" 163 " [--pae on|off]\n" 164 " [--hpet on|off]\n" 165 " [--hwvirtex on|off]\n" 166 " [--nestedpaging on|off]\n" 167 " [--largepages on|off]\n" 168 " [--vtxvpid on|off]\n" 169 " [--synthcpu on|off]\n" 170 " [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]\n" 171 " [--cpuidremove <leaf>]\n" 172 " [--cpuidremoveall]\n" 173 " [--hardwareuuid <uuid>]\n" 174 " [--cpus <number>]\n" 175 " [--cpuhotplug on|off]\n" 176 " [--plugcpu <id>]\n" 177 " [--unplugcpu <id>]\n" 178 " [--rtcuseutc on|off]\n" 179 " [--monitorcount <number>]\n" 180 " [--accelerate3d on|off]\n" 162 RTStrmPrintf(g_pStdErr, 163 "VBoxManage modifyvm <uuid|name>\n" 164 " [--name <name>]\n" 165 " [--ostype <ostype>]\n" 166 " [--memory <memorysize in MB>]\n" 167 " [--pagefusion on|off]\n" 168 " [--vram <vramsize in MB>]\n" 169 " [--acpi on|off]\n" 170 " [--ioapic on|off]\n" 171 " [--pae on|off]\n" 172 " [--hpet on|off]\n" 173 " [--hwvirtex on|off]\n" 174 " [--nestedpaging on|off]\n" 175 " [--largepages on|off]\n" 176 " [--vtxvpid on|off]\n" 177 " [--synthcpu on|off]\n" 178 " [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]\n" 179 " [--cpuidremove <leaf>]\n" 180 " [--cpuidremoveall]\n" 181 " [--hardwareuuid <uuid>]\n" 182 " [--cpus <number>]\n" 183 " [--cpuhotplug on|off]\n" 184 " [--plugcpu <id>]\n" 185 " [--unplugcpu <id>]\n" 186 " [--rtcuseutc on|off]\n" 187 " [--monitorcount <number>]\n" 188 " [--accelerate3d on|off]\n" 181 189 #ifdef VBOX_WITH_VIDEOHWACCEL 182 " [--accelerate2dvideo on|off]\n"183 #endif 184 " [--firmware bios|efi|efi32|efi64]\n"185 " [--bioslogofadein on|off]\n"186 " [--bioslogofadeout on|off]\n"187 " [--bioslogodisplaytime <msec>]\n"188 " [--bioslogoimagepath <imagepath>]\n"189 " [--biosbootmenu disabled|menuonly|messageandmenu]\n"190 " [--biossystemtimeoffset <msec>]\n"191 " [--biospxedebug on|off]\n"192 " [--boot<1-4> none|floppy|dvd|disk|net>]\n"193 " [--nic<1-N> none|null|nat|bridged|intnet"190 " [--accelerate2dvideo on|off]\n" 191 #endif 192 " [--firmware bios|efi|efi32|efi64]\n" 193 " [--bioslogofadein on|off]\n" 194 " [--bioslogofadeout on|off]\n" 195 " [--bioslogodisplaytime <msec>]\n" 196 " [--bioslogoimagepath <imagepath>]\n" 197 " [--biosbootmenu disabled|menuonly|messageandmenu]\n" 198 " [--biossystemtimeoffset <msec>]\n" 199 " [--biospxedebug on|off]\n" 200 " [--boot<1-4> none|floppy|dvd|disk|net>]\n" 201 " [--nic<1-N> none|null|nat|bridged|intnet" 194 202 #if defined(VBOX_WITH_NETFLT) 195 "|hostonly"203 "|hostonly" 196 204 #endif 197 205 #ifdef VBOX_WITH_VDE 198 "|\n"199 " vde"200 #endif 201 "]\n"202 " [--nictype<1-N> Am79C970A|Am79C973"206 "|\n" 207 " vde" 208 #endif 209 "]\n" 210 " [--nictype<1-N> Am79C970A|Am79C973" 203 211 #ifdef VBOX_WITH_E1000 204 "|\n 82540EM|82543GC|82545EM"212 "|\n 82540EM|82543GC|82545EM" 205 213 #endif 206 214 #ifdef VBOX_WITH_VIRTIO 207 "|\n virtio"215 "|\n virtio" 208 216 #endif /* VBOX_WITH_VIRTIO */ 209 "]\n"210 " [--cableconnected<1-N> on|off]\n"211 " [--nictrace<1-N> on|off]\n"212 " [--nictracefile<1-N> <filename>]\n"213 " [--nicspeed<1-N> <kbps>]\n"214 " [--nicbootprio<1-N> <priority>]\n"215 " [--bridgeadapter<1-N> none|<devicename>]\n"217 "]\n" 218 " [--cableconnected<1-N> on|off]\n" 219 " [--nictrace<1-N> on|off]\n" 220 " [--nictracefile<1-N> <filename>]\n" 221 " [--nicspeed<1-N> <kbps>]\n" 222 " [--nicbootprio<1-N> <priority>]\n" 223 " [--bridgeadapter<1-N> none|<devicename>]\n" 216 224 #if defined(VBOX_WITH_NETFLT) 217 " [--hostonlyadapter<1-N> none|<devicename>]\n"218 #endif 219 " [--intnet<1-N> <network name>]\n"220 " [--natnet<1-N> <network>|default]\n"225 " [--hostonlyadapter<1-N> none|<devicename>]\n" 226 #endif 227 " [--intnet<1-N> <network name>]\n" 228 " [--natnet<1-N> <network>|default]\n" 221 229 #ifdef VBOX_WITH_VDE 222 " [--vdenet<1-N> <network>|default]\n" 223 #endif 224 " [--natsettings<1-N> [<mtu>],[<socksnd>],\n" 225 " [<sockrcv>],[<tcpsnd>],\n" 226 " [<tcprcv>]]\n" 227 " [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],\n" 228 " <hostport>,[<guestip>],<guestport>]\n" 229 " [--natpf<1-N> delete <rulename>]\n" 230 " [--nattftpprefix<1-N> <prefix>]\n" 231 " [--nattftpfile<1-N> <file>]\n" 232 " [--nattftpserver<1-N> <ip>]\n" 233 " [--natdnspassdomain<1-N> on|off]\n" 234 " [--natdnsproxy<1-N> on|off]\n" 235 " [--natdnshostresolver<1-N> on|off]\n" 236 " [--nataliasmode<1-N> default|[log],[proxyonly],\n" 237 " [sameports]]\n" 238 " [--macaddress<1-N> auto|<mac>]\n" 239 " [--mouse ps2|usb|usbtablet\n" 240 " [--keyboard ps2|usb\n" 241 " [--uart<1-N> off|<I/O base> <IRQ>]\n" 242 " [--uartmode<1-N> disconnected|\n" 243 " server <pipe>|\n" 244 " client <pipe>|\n" 245 " file <file>|\n" 246 " <devicename>]\n" 247 " [--guestmemoryballoon <balloonsize in MB>]\n" 248 " [--gueststatisticsinterval <seconds>]\n" 249 ); 250 RTPrintf(" [--audio none|null"); 230 " [--vdenet<1-N> <network>|default]\n" 231 #endif 232 " [--natsettings<1-N> [<mtu>],[<socksnd>],\n" 233 " [<sockrcv>],[<tcpsnd>],\n" 234 " [<tcprcv>]]\n" 235 " [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],\n" 236 " <hostport>,[<guestip>],<guestport>]\n" 237 " [--natpf<1-N> delete <rulename>]\n" 238 " [--nattftpprefix<1-N> <prefix>]\n" 239 " [--nattftpfile<1-N> <file>]\n" 240 " [--nattftpserver<1-N> <ip>]\n" 241 " [--natdnspassdomain<1-N> on|off]\n" 242 " [--natdnsproxy<1-N> on|off]\n" 243 " [--natdnshostresolver<1-N> on|off]\n" 244 " [--nataliasmode<1-N> default|[log],[proxyonly],\n" 245 " [sameports]]\n" 246 " [--macaddress<1-N> auto|<mac>]\n" 247 " [--mouse ps2|usb|usbtablet\n" 248 " [--keyboard ps2|usb\n" 249 " [--uart<1-N> off|<I/O base> <IRQ>]\n" 250 " [--uartmode<1-N> disconnected|\n" 251 " server <pipe>|\n" 252 " client <pipe>|\n" 253 " file <file>|\n" 254 " <devicename>]\n" 255 " [--guestmemoryballoon <balloonsize in MB>]\n" 256 " [--gueststatisticsinterval <seconds>]\n" 257 " [--audio none|null"); 251 258 if (fWin) 252 259 { 253 260 #ifdef VBOX_WITH_WINMM 254 RT Printf("|winmm|dsound");261 RTStrmPrintf(g_pStdErr, "|winmm|dsound"); 255 262 #else 256 RT Printf("|dsound");263 RTStrmPrintf(g_pStdErr, "|dsound"); 257 264 #endif 258 265 } 259 266 if (fSolaris) 260 267 { 261 RT Printf("|solaudio"268 RTStrmPrintf(g_pStdErr, "|solaudio" 262 269 #ifdef VBOX_WITH_SOLARIS_OSS 263 264 #endif 265 270 "|oss" 271 #endif 272 ); 266 273 } 267 274 if (fLinux) 268 275 { 269 RT Printf("|oss"276 RTStrmPrintf(g_pStdErr, "|oss" 270 277 #ifdef VBOX_WITH_ALSA 271 278 "|alsa" 272 279 #endif 273 280 #ifdef VBOX_WITH_PULSE 274 275 #endif 276 281 "|pulse" 282 #endif 283 ); 277 284 } 278 285 if (fFreeBSD) … … 281 288 if (fDumpOpts) 282 289 { 283 RT Printf("|\n"284 " oss");290 RTStrmPrintf(g_pStdErr, "|\n" 291 " oss"); 285 292 } 286 293 else 287 RT Printf("|oss");294 RTStrmPrintf(g_pStdErr, "|oss"); 288 295 #ifdef VBOX_WITH_PULSE 289 RT Printf("|pulse");296 RTStrmPrintf(g_pStdErr, "|pulse"); 290 297 #endif 291 298 } 292 299 if (fDarwin) 293 300 { 294 RT Printf("|coreaudio");301 RTStrmPrintf(g_pStdErr, "|coreaudio"); 295 302 } 296 RTPrintf( "]\n"); 297 RTPrintf(" [--audiocontroller ac97|hda|sb16]\n" 298 " [--clipboard disabled|hosttoguest|guesttohost|\n" 299 " bidirectional]\n"); 303 RTStrmPrintf(g_pStdErr, "]\n"); 304 RTStrmPrintf(g_pStdErr, 305 " [--audiocontroller ac97|hda|sb16]\n" 306 " [--clipboard disabled|hosttoguest|guesttohost|\n" 307 " bidirectional]\n"); 300 308 if (fVRDP) 301 309 { 302 RTPrintf(" [--vrdp on|off]\n" 310 RTStrmPrintf(g_pStdErr, 311 " [--vrdp on|off]\n" 303 312 " [--vrdpport default|<ports>]\n" 304 313 " [--vrdpaddress <host>]\n" … … 309 318 " [--vrdpvideochannelquality <percent>]\n"); 310 319 } 311 RTPrintf(" [--usb on|off]\n" 312 " [--usbehci on|off]\n" 313 " [--snapshotfolder default|<path>]\n" 314 " [--teleporter on|off]\n" 315 " [--teleporterport <port>]\n" 316 " [--teleporteraddress <address|empty>\n" 317 " [--teleporterpassword <password>]\n" 320 RTStrmPrintf(g_pStdErr, 321 " [--usb on|off]\n" 322 " [--usbehci on|off]\n" 323 " [--snapshotfolder default|<path>]\n" 324 " [--teleporter on|off]\n" 325 " [--teleporterport <port>]\n" 326 " [--teleporteraddress <address|empty>\n" 327 " [--teleporterpassword <password>]\n" 318 328 #if 0 319 " [--iocache on|off]\n" 320 " [--iocachesize <I/O cache size in MB>]\n" 321 #endif 322 ); 323 RTPrintf(" [--faulttolerance master|standby]\n" 324 " [--faulttoleranceaddress <name>]\n" 325 " [--faulttoleranceport <port>]\n" 326 " [--faulttolerancesyncinterval <msec>]\n" 327 " [--faulttolerancepassword <password>]\n" 328 ); 329 330 RTPrintf("\n"); 329 " [--iocache on|off]\n" 330 " [--iocachesize <I/O cache size in MB>]\n" 331 #endif 332 " [--faulttolerance master|standby]\n" 333 " [--faulttoleranceaddress <name>]\n" 334 " [--faulttoleranceport <port>]\n" 335 " [--faulttolerancesyncinterval <msec>]\n" 336 " [--faulttolerancepassword <password>]\n" 337 "\n"); 331 338 } 332 339 333 340 if (u64Cmd & USAGE_IMPORTAPPLIANCE) 334 341 { 335 RTPrintf("VBoxManage import <ovf> [--dry-run|-n] [more options]\n" 336 " (run with -n to have options displayed\n" 337 " for a particular OVF)\n\n"); 342 RTStrmPrintf(g_pStdErr, 343 "VBoxManage import <ovf> [--dry-run|-n] [more options]\n" 344 " (run with -n to have options displayed\n" 345 " for a particular OVF)\n\n"); 338 346 } 339 347 340 348 if (u64Cmd & USAGE_EXPORTAPPLIANCE) 341 349 { 342 RTPrintf("VBoxManage export <machines> --output|-o <ovf>\n" 343 " [--legacy09]\n" 344 " [--manifest]\n" 345 " [--vsys <number of virtual system>]\n" 346 " [--product <product name>]\n" 347 " [--producturl <product url>]\n" 348 " [--vendor <vendor name>]\n" 349 " [--vendorurl <vendor url>]\n" 350 " [--version <version info>]\n" 351 " [--eula <license text>]\n" 352 " [--eulafile <filename>]\n" 353 "\n"); 350 RTStrmPrintf(g_pStdErr, 351 "VBoxManage export <machines> --output|-o <ovf>\n" 352 " [--legacy09]\n" 353 " [--manifest]\n" 354 " [--vsys <number of virtual system>]\n" 355 " [--product <product name>]\n" 356 " [--producturl <product url>]\n" 357 " [--vendor <vendor name>]\n" 358 " [--vendorurl <vendor url>]\n" 359 " [--version <version info>]\n" 360 " [--eula <license text>]\n" 361 " [--eulafile <filename>]\n" 362 "\n"); 354 363 } 355 364 356 365 if (u64Cmd & USAGE_STARTVM) 357 366 { 358 RTPrintf("VBoxManage startvm <uuid>|<name>\n"); 359 RTPrintf(" [--type gui"); 367 RTStrmPrintf(g_pStdErr, 368 "VBoxManage startvm <uuid>|<name>\n"); 369 RTStrmPrintf(g_pStdErr, 370 " [--type gui"); 360 371 if (fVBoxSDL) 361 RT Printf("|sdl");372 RTStrmPrintf(g_pStdErr, "|sdl"); 362 373 if (fVRDP) 363 RTPrintf( "|vrdp"); 364 RTPrintf( "|headless]\n"); 365 RTPrintf("\n"); 374 RTStrmPrintf(g_pStdErr, "|vrdp"); 375 RTStrmPrintf(g_pStdErr, "|headless]\n"); 376 RTStrmPrintf(g_pStdErr, 377 "\n"); 366 378 } 367 379 368 380 if (u64Cmd & USAGE_CONTROLVM) 369 381 { 370 RTPrintf("VBoxManage controlvm <uuid>|<name>\n" 371 " pause|resume|reset|poweroff|savestate|\n" 372 " acpipowerbutton|acpisleepbutton|\n" 373 " keyboardputscancode <hex> [<hex> ...]|\n" 374 " injectnmi|\n" 375 " setlinkstate<1-N> on|off |\n" 382 RTStrmPrintf(g_pStdErr, 383 "VBoxManage controlvm <uuid>|<name>\n" 384 " pause|resume|reset|poweroff|savestate|\n" 385 " acpipowerbutton|acpisleepbutton|\n" 386 " keyboardputscancode <hex> [<hex> ...]|\n" 387 " injectnmi|\n" 388 " setlinkstate<1-N> on|off |\n" 376 389 #ifdef VBOX_DYNAMIC_NET_ATTACH 377 390 #if defined(VBOX_WITH_NETFLT) 378 " nic<1-N> null|nat|bridged|intnet|hostonly\n"379 " [<devicename>] |\n"391 " nic<1-N> null|nat|bridged|intnet|hostonly\n" 392 " [<devicename>] |\n" 380 393 #else /* !RT_OS_LINUX && !RT_OS_DARWIN */ 381 " nic<1-N> null|nat|bridged|intnet\n"382 " [<devicename>] |\n"394 " nic<1-N> null|nat|bridged|intnet\n" 395 " [<devicename>] |\n" 383 396 #endif /* !RT_OS_LINUX && !RT_OS_DARWIN */ 384 " nictrace<1-N> on|off\n"385 " nictracefile<1-N> <filename>\n"397 " nictrace<1-N> on|off\n" 398 " nictracefile<1-N> <filename>\n" 386 399 #endif /* VBOX_DYNAMIC_NET_ATTACH */ 387 " guestmemoryballoon <balloonsize in MB>]\n"388 " gueststatisticsinterval <seconds>]\n"389 " usbattach <uuid>|<address> |\n"390 " usbdetach <uuid>|<address> |\n");400 " guestmemoryballoon <balloonsize in MB>]\n" 401 " gueststatisticsinterval <seconds>]\n" 402 " usbattach <uuid>|<address> |\n" 403 " usbdetach <uuid>|<address> |\n"); 391 404 if (fVRDP) 392 405 { 393 RTPrintf(" vrdp on|off |\n"); 394 RTPrintf(" vrdpport default|<ports> |\n" 406 RTStrmPrintf(g_pStdErr, 407 " vrdp on|off |\n"); 408 RTStrmPrintf(g_pStdErr, 409 " vrdpport default|<ports> |\n" 395 410 " vrdpvideochannelquality <percent>\n"); 396 411 } 397 RTPrintf(" setvideomodehint <xres> <yres> <bpp> [display] |\n" 398 " setcredentials <username> <password> <domain>\n" 399 " [--allowlocallogon <yes|no>] |\n" 400 " teleport --host <name> --port <port>\n" 401 " [--maxdowntime <msec>] [--password password]\n" 402 " plugcpu <id>\n" 403 " unplugcpu <id>\n" 404 "\n"); 412 RTStrmPrintf(g_pStdErr, 413 " setvideomodehint <xres> <yres> <bpp> [display] |\n" 414 " setcredentials <username> <password> <domain>\n" 415 " [--allowlocallogon <yes|no>] |\n" 416 " teleport --host <name> --port <port>\n" 417 " [--maxdowntime <msec>] [--password password]\n" 418 " plugcpu <id>\n" 419 " unplugcpu <id>\n" 420 "\n"); 405 421 } 406 422 407 423 if (u64Cmd & USAGE_DISCARDSTATE) 408 424 { 409 RTPrintf("VBoxManage discardstate <uuid>|<name>\n" 410 "\n"); 425 RTStrmPrintf(g_pStdErr, 426 "VBoxManage discardstate <uuid>|<name>\n" 427 "\n"); 411 428 } 412 429 413 430 if (u64Cmd & USAGE_ADOPTSTATE) 414 431 { 415 RTPrintf("VBoxManage adoptstate <uuid>|<name> <state_file>\n" 416 "\n"); 432 RTStrmPrintf(g_pStdErr, 433 "VBoxManage adoptstate <uuid>|<name> <state_file>\n" 434 "\n"); 417 435 } 418 436 419 437 if (u64Cmd & USAGE_SNAPSHOT) 420 438 { 421 RTPrintf("VBoxManage snapshot <uuid>|<name>\n" 422 " take <name> [--description <desc>] [--pause] |\n" 423 " delete <uuid>|<name> |\n" 424 " restore <uuid>|<name> |\n" 425 " restorecurrent |\n" 426 " edit <uuid>|<name>|--current\n" 427 " [--name <name>]\n" 428 " [--description <desc>] |\n" 429 " showvminfo <uuid>|<name>\n" 430 "\n"); 439 RTStrmPrintf(g_pStdErr, 440 "VBoxManage snapshot <uuid>|<name>\n" 441 " take <name> [--description <desc>] [--pause] |\n" 442 " delete <uuid>|<name> |\n" 443 " restore <uuid>|<name> |\n" 444 " restorecurrent |\n" 445 " edit <uuid>|<name>|--current\n" 446 " [--name <name>]\n" 447 " [--description <desc>] |\n" 448 " showvminfo <uuid>|<name>\n" 449 "\n"); 431 450 } 432 451 433 452 if (u64Cmd & USAGE_OPENMEDIUM) 434 453 { 435 RTPrintf("VBoxManage openmedium disk|dvd|floppy <filename>\n" 436 " [--type normal|immutable|writethrough|\n" 437 " shareable] (disk only)\n" 438 " [--uuid <uuid>]\n" 439 " [--parentuuid <uuid>] (disk only)\n" 440 "\n"); 454 RTStrmPrintf(g_pStdErr, 455 "VBoxManage openmedium disk|dvd|floppy <filename>\n" 456 " [--type normal|immutable|writethrough|\n" 457 " shareable] (disk only)\n" 458 " [--uuid <uuid>]\n" 459 " [--parentuuid <uuid>] (disk only)\n" 460 "\n"); 441 461 } 442 462 443 463 if (u64Cmd & USAGE_CLOSEMEDIUM) 444 464 { 445 RTPrintf("VBoxManage closemedium disk|dvd|floppy <uuid>|<filename>\n" 446 " [--delete]\n" 447 "\n"); 465 RTStrmPrintf(g_pStdErr, 466 "VBoxManage closemedium disk|dvd|floppy <uuid>|<filename>\n" 467 " [--delete]\n" 468 "\n"); 448 469 } 449 470 450 471 if (u64Cmd & USAGE_STORAGEATTACH) 451 472 { 452 RTPrintf("VBoxManage storageattach <uuid|vmname>\n" 453 " --storagectl <name>\n" 454 " --port <number>\n" 455 " --device <number>\n" 456 " [--type dvddrive|hdd|fdd]\n" 457 " [--medium none|emptydrive|\n" 458 " <uuid>|<filename>|host:<drive>]\n" 459 " [--passthrough on|off]\n" 460 " [--forceunmount]\n" 461 "\n"); 473 RTStrmPrintf(g_pStdErr, 474 "VBoxManage storageattach <uuid|vmname>\n" 475 " --storagectl <name>\n" 476 " --port <number>\n" 477 " --device <number>\n" 478 " [--type dvddrive|hdd|fdd]\n" 479 " [--medium none|emptydrive|\n" 480 " <uuid>|<filename>|host:<drive>]\n" 481 " [--passthrough on|off]\n" 482 " [--forceunmount]\n" 483 "\n"); 462 484 } 463 485 464 486 if (u64Cmd & USAGE_STORAGECONTROLLER) 465 487 { 466 RTPrintf("VBoxManage storagectl <uuid|vmname>\n" 467 " --name <name>\n" 468 " [--add ide|sata|scsi|floppy|sas]\n" 469 " [--controller LSILogic|LSILogicSAS|BusLogic|\n" 470 " IntelAHCI|PIIX3|PIIX4|ICH6|I82078]\n" 471 " [--sataideemulation<1-4> <1-30>]\n" 472 " [--sataportcount <1-30>]\n" 473 " [--hostiocache on|off]\n" 474 " [--remove]\n" 475 "\n"); 488 RTStrmPrintf(g_pStdErr, 489 "VBoxManage storagectl <uuid|vmname>\n" 490 " --name <name>\n" 491 " [--add ide|sata|scsi|floppy|sas]\n" 492 " [--controller LSILogic|LSILogicSAS|BusLogic|\n" 493 " IntelAHCI|PIIX3|PIIX4|ICH6|I82078]\n" 494 " [--sataideemulation<1-4> <1-30>]\n" 495 " [--sataportcount <1-30>]\n" 496 " [--hostiocache on|off]\n" 497 " [--remove]\n" 498 "\n"); 476 499 } 477 500 478 501 if (u64Cmd & USAGE_SHOWHDINFO) 479 502 { 480 RTPrintf("VBoxManage showhdinfo <uuid>|<filename>\n" 481 "\n"); 503 RTStrmPrintf(g_pStdErr, 504 "VBoxManage showhdinfo <uuid>|<filename>\n" 505 "\n"); 482 506 } 483 507 484 508 if (u64Cmd & USAGE_CREATEHD) 485 509 { 486 RTPrintf("VBoxManage createhd --filename <filename>\n" 487 " --size <megabytes>|--sizebyte <bytes>\n" 488 " [--format VDI|VMDK|VHD] (default: VDI)\n" 489 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 490 " [--type normal|writethrough|\n" 491 " shareable] (default: normal)\n" 492 " [--comment <comment>]\n" 493 " [--remember]\n" 494 "\n"); 510 RTStrmPrintf(g_pStdErr, 511 "VBoxManage createhd --filename <filename>\n" 512 " --size <megabytes>|--sizebyte <bytes>\n" 513 " [--format VDI|VMDK|VHD] (default: VDI)\n" 514 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 515 " [--type normal|writethrough|\n" 516 " shareable] (default: normal)\n" 517 " [--comment <comment>]\n" 518 " [--remember]\n" 519 "\n"); 495 520 } 496 521 497 522 if (u64Cmd & USAGE_MODIFYHD) 498 523 { 499 RTPrintf("VBoxManage modifyhd <uuid>|<filename>\n" 500 " [--type normal|writethrough|immutable|shareable]\n" 501 " [--autoreset on|off]\n" 502 " [--compact]\n" 503 " [--resize <megabytes>]\n" 504 "\n"); 524 RTStrmPrintf(g_pStdErr, 525 "VBoxManage modifyhd <uuid>|<filename>\n" 526 " [--type normal|writethrough|immutable|shareable]\n" 527 " [--autoreset on|off]\n" 528 " [--compact]\n" 529 " [--resize <megabytes>]\n" 530 "\n"); 505 531 } 506 532 507 533 if (u64Cmd & USAGE_CLONEHD) 508 534 { 509 RTPrintf("VBoxManage clonehd <uuid>|<filename> <outputfile>\n" 510 " [--format VDI|VMDK|VHD|RAW|<other>]\n" 511 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 512 " [--type normal|writethrough|immutable|shareable]\n" 513 " [--remember] [--existing]\n" 514 "\n"); 535 RTStrmPrintf(g_pStdErr, 536 "VBoxManage clonehd <uuid>|<filename> <outputfile>\n" 537 " [--format VDI|VMDK|VHD|RAW|<other>]\n" 538 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 539 " [--type normal|writethrough|immutable|shareable]\n" 540 " [--remember] [--existing]\n" 541 "\n"); 515 542 } 516 543 517 544 if (u64Cmd & USAGE_CONVERTFROMRAW) 518 545 { 519 RTPrintf("VBoxManage convertfromraw <filename> <outputfile>\n" 520 " [--format VDI|VMDK|VHD]\n" 521 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 546 RTStrmPrintf(g_pStdErr, 547 "VBoxManage convertfromraw <filename> <outputfile>\n" 548 " [--format VDI|VMDK|VHD]\n" 549 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 522 550 #ifndef RT_OS_WINDOWS 523 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n"524 " [--format VDI|VMDK|VHD]\n"525 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"526 #endif 527 "\n");551 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n" 552 " [--format VDI|VMDK|VHD]\n" 553 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n" 554 #endif 555 "\n"); 528 556 } 529 557 530 558 if (u64Cmd & USAGE_ADDISCSIDISK) 531 559 { 532 RTPrintf("VBoxManage addiscsidisk --server <name>|<ip>\n" 533 " --target <target>\n" 534 " [--port <port>]\n" 535 " [--lun <lun>]\n" 536 " [--encodedlun <lun>]\n" 537 " [--username <username>]\n" 538 " [--password <password>]\n" 539 " [--type normal|writethrough|immutable|shareable]\n" 540 " [--intnet]\n" 541 "\n"); 560 RTStrmPrintf(g_pStdErr, 561 "VBoxManage addiscsidisk --server <name>|<ip>\n" 562 " --target <target>\n" 563 " [--port <port>]\n" 564 " [--lun <lun>]\n" 565 " [--encodedlun <lun>]\n" 566 " [--username <username>]\n" 567 " [--password <password>]\n" 568 " [--type normal|writethrough|immutable|shareable]\n" 569 " [--intnet]\n" 570 "\n"); 542 571 } 543 572 544 573 if (u64Cmd & USAGE_GETEXTRADATA) 545 574 { 546 RTPrintf("VBoxManage getextradata global|<uuid>|<name>\n" 547 " <key>|enumerate\n" 548 "\n"); 575 RTStrmPrintf(g_pStdErr, 576 "VBoxManage getextradata global|<uuid>|<name>\n" 577 " <key>|enumerate\n" 578 "\n"); 549 579 } 550 580 551 581 if (u64Cmd & USAGE_SETEXTRADATA) 552 582 { 553 RTPrintf("VBoxManage setextradata global|<uuid>|<name>\n" 554 " <key>\n" 555 " [<value>] (no value deletes key)\n" 556 "\n"); 583 RTStrmPrintf(g_pStdErr, 584 "VBoxManage setextradata global|<uuid>|<name>\n" 585 " <key>\n" 586 " [<value>] (no value deletes key)\n" 587 "\n"); 557 588 } 558 589 559 590 if (u64Cmd & USAGE_SETPROPERTY) 560 591 { 561 RTPrintf("VBoxManage setproperty hdfolder default|<folder> |\n" 562 " machinefolder default|<folder> |\n" 563 " vrdpauthlibrary default|<library> |\n" 564 " websrvauthlibrary default|null|<library> |\n" 565 " loghistorycount <value>\n" 566 "\n"); 592 RTStrmPrintf(g_pStdErr, 593 "VBoxManage setproperty hdfolder default|<folder> |\n" 594 " machinefolder default|<folder> |\n" 595 " vrdpauthlibrary default|<library> |\n" 596 " websrvauthlibrary default|null|<library> |\n" 597 " loghistorycount <value>\n" 598 "\n"); 567 599 } 568 600 569 601 if (u64Cmd & USAGE_USBFILTER_ADD) 570 602 { 571 RTPrintf("VBoxManage usbfilter add <index,0-N>\n" 572 " --target <uuid>|<name>|global\n" 573 " --name <string>\n" 574 " --action ignore|hold (global filters only)\n" 575 " [--active yes|no] (yes)\n" 576 " [--vendorid <XXXX>] (null)\n" 577 " [--productid <XXXX>] (null)\n" 578 " [--revision <IIFF>] (null)\n" 579 " [--manufacturer <string>] (null)\n" 580 " [--product <string>] (null)\n" 581 " [--remote yes|no] (null, VM filters only)\n" 582 " [--serialnumber <string>] (null)\n" 583 " [--maskedinterfaces <XXXXXXXX>]\n" 584 "\n"); 603 RTStrmPrintf(g_pStdErr, 604 "VBoxManage usbfilter add <index,0-N>\n" 605 " --target <uuid>|<name>|global\n" 606 " --name <string>\n" 607 " --action ignore|hold (global filters only)\n" 608 " [--active yes|no] (yes)\n" 609 " [--vendorid <XXXX>] (null)\n" 610 " [--productid <XXXX>] (null)\n" 611 " [--revision <IIFF>] (null)\n" 612 " [--manufacturer <string>] (null)\n" 613 " [--product <string>] (null)\n" 614 " [--remote yes|no] (null, VM filters only)\n" 615 " [--serialnumber <string>] (null)\n" 616 " [--maskedinterfaces <XXXXXXXX>]\n" 617 "\n"); 585 618 } 586 619 587 620 if (u64Cmd & USAGE_USBFILTER_MODIFY) 588 621 { 589 RTPrintf("VBoxManage usbfilter modify <index,0-N>\n" 590 " --target <uuid>|<name>|global\n" 591 " [--name <string>]\n" 592 " [--action ignore|hold] (global filters only)\n" 593 " [--active yes|no]\n" 594 " [--vendorid <XXXX>|\"\"]\n" 595 " [--productid <XXXX>|\"\"]\n" 596 " [--revision <IIFF>|\"\"]\n" 597 " [--manufacturer <string>|\"\"]\n" 598 " [--product <string>|\"\"]\n" 599 " [--remote yes|no] (null, VM filters only)\n" 600 " [--serialnumber <string>|\"\"]\n" 601 " [--maskedinterfaces <XXXXXXXX>]\n" 602 "\n"); 622 RTStrmPrintf(g_pStdErr, 623 "VBoxManage usbfilter modify <index,0-N>\n" 624 " --target <uuid>|<name>|global\n" 625 " [--name <string>]\n" 626 " [--action ignore|hold] (global filters only)\n" 627 " [--active yes|no]\n" 628 " [--vendorid <XXXX>|\"\"]\n" 629 " [--productid <XXXX>|\"\"]\n" 630 " [--revision <IIFF>|\"\"]\n" 631 " [--manufacturer <string>|\"\"]\n" 632 " [--product <string>|\"\"]\n" 633 " [--remote yes|no] (null, VM filters only)\n" 634 " [--serialnumber <string>|\"\"]\n" 635 " [--maskedinterfaces <XXXXXXXX>]\n" 636 "\n"); 603 637 } 604 638 605 639 if (u64Cmd & USAGE_USBFILTER_REMOVE) 606 640 { 607 RTPrintf("VBoxManage usbfilter remove <index,0-N>\n" 608 " --target <uuid>|<name>|global\n" 609 "\n"); 641 RTStrmPrintf(g_pStdErr, 642 "VBoxManage usbfilter remove <index,0-N>\n" 643 " --target <uuid>|<name>|global\n" 644 "\n"); 610 645 } 611 646 612 647 if (u64Cmd & USAGE_SHAREDFOLDER_ADD) 613 648 { 614 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n" 615 " --name <name> --hostpath <hostpath>\n" 616 " [--transient] [--readonly] [--automount]\n" 617 "\n"); 649 RTStrmPrintf(g_pStdErr, 650 "VBoxManage sharedfolder add <vmname>|<uuid>\n" 651 " --name <name> --hostpath <hostpath>\n" 652 " [--transient] [--readonly] [--automount]\n" 653 "\n"); 618 654 } 619 655 620 656 if (u64Cmd & USAGE_SHAREDFOLDER_REMOVE) 621 657 { 622 RTPrintf("VBoxManage sharedfolder remove <vmname>|<uuid>\n" 623 " --name <name> [--transient]\n" 624 "\n"); 658 RTStrmPrintf(g_pStdErr, 659 "VBoxManage sharedfolder remove <vmname>|<uuid>\n" 660 " --name <name> [--transient]\n" 661 "\n"); 625 662 } 626 663 627 664 if (u64Cmd & USAGE_VM_STATISTICS) 628 665 { 629 RTPrintf("VBoxManage vmstatistics <vmname>|<uuid> [--reset]\n" 630 " [--pattern <pattern>] [--descriptions]\n" 631 "\n"); 666 RTStrmPrintf(g_pStdErr, 667 "VBoxManage vmstatistics <vmname>|<uuid> [--reset]\n" 668 " [--pattern <pattern>] [--descriptions]\n" 669 "\n"); 632 670 } 633 671 … … 644 682 if (u64Cmd & USAGE_METRICS) 645 683 { 646 RTPrintf("VBoxManage metrics list [*|host|<vmname> [<metric_list>]]\n" 647 " (comma-separated)\n\n" 648 "VBoxManage metrics setup\n" 649 " [--period <seconds>] (default: 1)\n" 650 " [--samples <count>] (default: 1)\n" 651 " [--list]\n" 652 " [*|host|<vmname> [<metric_list>]]\n\n" 653 "VBoxManage metrics query [*|host|<vmname> [<metric_list>]]\n\n" 654 "VBoxManage metrics enable\n" 655 " [--list]\n" 656 " [*|host|<vmname> [<metric_list>]]\n\n" 657 "VBoxManage metrics disable\n" 658 " [--list]\n" 659 " [*|host|<vmname> [<metric_list>]]\n\n" 660 "VBoxManage metrics collect\n" 661 " [--period <seconds>] (default: 1)\n" 662 " [--samples <count>] (default: 1)\n" 663 " [--list]\n" 664 " [--detach]\n" 665 " [*|host|<vmname> [<metric_list>]]\n" 666 "\n"); 684 RTStrmPrintf(g_pStdErr, 685 "VBoxManage metrics list [*|host|<vmname> [<metric_list>]]\n" 686 " (comma-separated)\n\n" 687 "VBoxManage metrics setup\n" 688 " [--period <seconds>] (default: 1)\n" 689 " [--samples <count>] (default: 1)\n" 690 " [--list]\n" 691 " [*|host|<vmname> [<metric_list>]]\n\n" 692 "VBoxManage metrics query [*|host|<vmname> [<metric_list>]]\n\n" 693 "VBoxManage metrics enable\n" 694 " [--list]\n" 695 " [*|host|<vmname> [<metric_list>]]\n\n" 696 "VBoxManage metrics disable\n" 697 " [--list]\n" 698 " [*|host|<vmname> [<metric_list>]]\n\n" 699 "VBoxManage metrics collect\n" 700 " [--period <seconds>] (default: 1)\n" 701 " [--samples <count>] (default: 1)\n" 702 " [--list]\n" 703 " [--detach]\n" 704 " [*|host|<vmname> [<metric_list>]]\n" 705 "\n"); 667 706 } 668 707 #if defined(VBOX_WITH_NETFLT) 669 708 if (u64Cmd & USAGE_HOSTONLYIFS) 670 709 { 671 RTPrintf("VBoxManage hostonlyif ipconfig <name>\n" 672 " [--dhcp |\n" 673 " --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n" 674 " --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n" 710 RTStrmPrintf(g_pStdErr, 711 "VBoxManage hostonlyif ipconfig <name>\n" 712 " [--dhcp |\n" 713 " --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n" 714 " --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n" 675 715 # if defined(RT_OS_WINDOWS) 676 " create |\n"677 " remove <name>\n"716 " create |\n" 717 " remove <name>\n" 678 718 # endif 679 "\n");719 "\n"); 680 720 } 681 721 #endif … … 683 723 if (u64Cmd & USAGE_DHCPSERVER) 684 724 { 685 RTPrintf("VBoxManage dhcpserver add|modify --netname <network_name> |\n" 725 RTStrmPrintf(g_pStdErr, 726 "VBoxManage dhcpserver add|modify --netname <network_name> |\n" 686 727 #if defined(VBOX_WITH_NETFLT) 687 " --ifname <hostonly_if_name>\n"688 #endif 689 " [--ip <ip_address>\n"690 " --netmask <network_mask>\n"691 " --lowerip <lower_ip>\n"692 " --upperip <upper_ip>]\n"693 " [--enable | --disable]\n\n"694 "VBoxManage dhcpserver remove --netname <network_name> |\n"728 " --ifname <hostonly_if_name>\n" 729 #endif 730 " [--ip <ip_address>\n" 731 " --netmask <network_mask>\n" 732 " --lowerip <lower_ip>\n" 733 " --upperip <upper_ip>]\n" 734 " [--enable | --disable]\n\n" 735 "VBoxManage dhcpserver remove --netname <network_name> |\n" 695 736 #if defined(VBOX_WITH_NETFLT) 696 " --ifname <hostonly_if_name>\n"697 #endif 698 "\n");737 " --ifname <hostonly_if_name>\n" 738 #endif 739 "\n"); 699 740 } 700 741 } … … 714 755 #endif /* !VBOX_ONLY_DOCS */ 715 756 va_start(args, pszFormat); 716 RTPrintf("\n" 717 "Syntax error: %N\n", pszFormat, &args); 757 RTStrmPrintf(g_pStdErr, "\nSyntax error: %N\n", pszFormat, &args); 718 758 va_end(args); 719 759 return 1; … … 740 780 741 781 if (rc == VINF_GETOPT_NOT_OPTION) 742 return RT Printf("error: Invalid parameter '%s'\n", pValueUnion->psz);782 return RTMsgError("Invalid parameter '%s'", pValueUnion->psz); 743 783 if (rc > 0) 744 784 { 745 785 if (RT_C_IS_PRINT(rc)) 746 return RT Printf("error: Invalid option -%c\n", rc);747 return RT Printf("error: Invalid option case %i\n", rc);786 return RTMsgError("Invalid option -%c", rc); 787 return RTMsgError("Invalid option case %i", rc); 748 788 } 749 789 if (rc == VERR_GETOPT_UNKNOWN_OPTION) 750 return RT Printf("error: unknown option: %s\n", pValueUnion->psz);790 return RTMsgError("Unknown option: %s", pValueUnion->psz); 751 791 if (pValueUnion->pDef) 752 return RT Printf("error: %s: %Rrs\n", pValueUnion->pDef->pszLong, rc);753 return RT Printf("error: %Rrs\n", rc);792 return RTMsgError("%s: %Rrs", pValueUnion->pDef->pszLong, rc); 793 return RTMsgError("%Rrs", rc); 754 794 } 755 795 … … 761 801 va_list args; 762 802 va_start(args, pszFormat); 763 RT Printf("error: %N\n", pszFormat, &args);803 RTMsgError(pszFormat, args); 764 804 va_end(args); 765 805 return 1; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp
r31539 r32701 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 28 28 #include <VBox/com/VirtualBox.h> 29 30 #include <vector>31 #include <list>32 29 #endif /* !VBOX_ONLY_DOCS */ 33 30 … … 73 70 com::ProgressErrorInfo info(progress); 74 71 if (info.isBasicAvailable()) 75 RT Printf("Error: failed to create the host-only adapter. Error message: %lS\n", info.getText().raw());72 RTMsgError("Failed to create the host-only adapter. Error message: %lS", info.getText().raw()); 76 73 else 77 RT Printf("Error: failed to create the host-only adapter. No error message available, HRESULT code: 0x%x\n", rc);74 RTMsgError("Failed to create the host-only adapter. No error message available, code: %Rhrc", rc); 78 75 79 76 return 1; … … 117 114 com::ProgressErrorInfo info(progress); 118 115 if (info.isBasicAvailable()) 119 RT Printf("Error: failed to remove the host-only adapter. Error message: %lS\n", info.getText().raw());116 RTMsgError("Failed to remove the host-only adapter. Error message: %lS", info.getText().raw()); 120 117 else 121 RT Printf("Error: failed to remove the host-only adapter. No error message available, HRESULT code: 0x%x\n", rc);118 RTMsgError("Failed to remove the host-only adapter. No error message available, code: %Rhrc", rc); 122 119 123 120 return 1; … … 262 259 if (!bIpV6Supported) 263 260 { 264 RT Printf("IPv6 setting is not supported for this adapter\n");261 RTMsgError("IPv6 setting is not supported for this adapter"); 265 262 return 1; 266 263 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
r32448 r32701 5 5 6 6 /* 7 * Copyright (C) 2009 Oracle Corporation7 * Copyright (C) 2009-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 265 265 // call interpret(); this can yield both warnings and errors, so we need 266 266 // to tinker with the error info a bit 267 RT Printf("Interpreting %ls...\n", path.raw());267 RTStrmPrintf(g_pStdErr, "Interpreting %ls...\n", path.raw()); 268 268 rc = pAppliance->Interpret(); 269 269 com::ErrorInfo info0(pAppliance, COM_IIDOF(IAppliance)); … … 276 276 { 277 277 Bstr bstrWarning(aWarnings[i]); 278 RT Printf("WARNING: %ls.\n", bstrWarning.raw());278 RTMsgWarning("%ls.", bstrWarning.raw()); 279 279 } 280 280 } … … 287 287 } 288 288 289 RT Printf("OK.\n");289 RTStrmPrintf(g_pStdErr, "OK.\n"); 290 290 291 291 // fetch all disks … … 693 693 694 694 if (cLicensesInTheWay == 1) 695 RT Printf("ERROR: Cannot import until the license agreement listed above is accepted.\n");695 RTMsgError("Cannot import until the license agreement listed above is accepted."); 696 696 else if (cLicensesInTheWay > 1) 697 RT Printf("ERROR: Cannot import until the %c license agreements listed above are accepted.\n", cLicensesInTheWay);697 RTMsgError("Cannot import until the %c license agreements listed above are accepted.", cLicensesInTheWay); 698 698 699 699 if (!cLicensesInTheWay && fExecute) … … 935 935 else 936 936 { 937 RTPrintf("ERROR: Cannot read license file \"%s\" which should be included in the virtual system %u.\n", 938 itD->second.c_str(), 939 i); 937 RTMsgError("Cannot read license file \"%s\" which should be included in the virtual system %u.", 938 itD->second.c_str(), i); 940 939 return 1; 941 940 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r32086 r32701 1093 1093 ulIOBase, ulIRQ); 1094 1094 else 1095 RTPrintf("UART %d: I/O base: 0x%04x, IRQ: %d",1095 RTPrintf("UART %d: I/O base: %#06x, IRQ: %d", 1096 1096 currentUART + 1, ulIOBase, ulIRQ); 1097 1097 switch (HostMode) … … 1494 1494 CHECK_ERROR_RET (DevPtr, COMGETTER (MaskedInterfaces) (&fMaskedIfs), rc); 1495 1495 if (fMaskedIfs) 1496 RTPrintf("Masked Interfaces: 0x%08x\n", fMaskedIfs);1496 RTPrintf("Masked Interfaces: %#010x\n", fMaskedIfs); 1497 1497 RTPrintf("\n"); 1498 1498 } … … 1543 1543 else 1544 1544 RTPrintf("UUID: %S\n" 1545 "VendorId: 0x%04x (%04X)\n"1546 "ProductId: 0x%04x (%04X)\n"1545 "VendorId: %#06x (%04X)\n" 1546 "ProductId: %#06x (%04X)\n" 1547 1547 "Revision: %u.%u (%02u%02u)\n", 1548 1548 Utf8Str(id).c_str(), … … 1632 1632 else 1633 1633 RTPrintf("UUID: %S\n" 1634 "VendorId: 0x%04x (%04X)\n"1635 "ProductId: 0x%04x (%04X)\n"1634 "VendorId: %#06x (%04X)\n" 1635 "ProductId: %#06x (%04X)\n" 1636 1636 "Revision: %u.%u (%02u%02u)\n", 1637 1637 Utf8Str(id).c_str(), -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r32531 r32701 703 703 704 704 RTPrintf("UUID: %S\n" 705 "VendorId: 0x%04x (%04X)\n"706 "ProductId: 0x%04x (%04X)\n"707 "Revision: %u.%u (%02u%02u)\n",708 Utf8Str(id).c_str(),709 usVendorId, usVendorId, usProductId, usProductId,710 bcdRevision >> 8, bcdRevision & 0xff,711 bcdRevision >> 8, bcdRevision & 0xff);705 "VendorId: %#06x (%04X)\n" 706 "ProductId: %#06x (%04X)\n" 707 "Revision: %u.%u (%02u%02u)\n", 708 Utf8Str(id).c_str(), 709 usVendorId, usVendorId, usProductId, usProductId, 710 bcdRevision >> 8, bcdRevision & 0xff, 711 bcdRevision >> 8, bcdRevision & 0xff); 712 712 713 713 /* optional stuff. */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
r28800 r32701 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 176 176 else 177 177 { 178 RT Printf("No metrics match the specified filter!\n");178 RTMsgError("No metrics match the specified filter!"); 179 179 } 180 180 } 181 181 182 182 /** 183 * list *183 * list 184 184 */ 185 185 static int handleMetricsList(int argc, char *argv[], … … 465 465 if (isDetached) 466 466 { 467 RT Printf("Warning!The background process holding collected metrics will shutdown\n"468 "in few seconds, discarding all collected data and parameters.\n");467 RTMsgWarning("The background process holding collected metrics will shutdown\n" 468 "in few seconds, discarding all collected data and parameters."); 469 469 return 0; 470 470 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r31595 r32701 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 31 31 #include <VBox/com/VirtualBox.h> 32 33 #include <vector>34 #include <list>35 32 #endif /* !VBOX_ONLY_DOCS */ 36 33 … … 80 77 if (RT_FAILURE(vrc)) 81 78 { 82 RT Printf("Cannot convert filename \"%s\" to absolute path\n", a->argv[0]);79 RTMsgError("Cannot convert filename \"%s\" to absolute path", a->argv[0]); 83 80 return 1; 84 81 } … … 231 228 return errorSyntax(USAGE_CREATEVM, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str()); 232 229 } 233 if (!name) 230 231 /* check for required options */ 232 if (name) 234 233 return errorSyntax(USAGE_CREATEVM, "Parameter --name is required"); 235 234 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r31991 r32701 27 27 28 28 #include <VBox/com/VirtualBox.h> 29 30 #include <vector>31 #include <list>32 29 #endif /* !VBOX_ONLY_DOCS */ 33 30 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r31539 r32701 315 315 com::ProgressErrorInfo info(progress); 316 316 if (info.isBasicAvailable()) 317 RT Printf("Error: failed to take snapshot. Error message: %lS\n", info.getText().raw());317 RTMsgError("Failed to take snapshot. Error message: %lS", info.getText().raw()); 318 318 else 319 RT Printf("Error: failed to take snapshot. No error message available!\n");319 RTMsgError("Failed to take snapshot. No error message available!"); 320 320 } 321 321 … … 393 393 com::ProgressErrorInfo info(pProgress); 394 394 if (info.isBasicAvailable()) 395 RT Printf("Error: snapshot operation failed. Error message: %lS\n", info.getText().raw());395 RTMsgError("Snapshot operation failed. Error message: %lS", info.getText().raw()); 396 396 else 397 RT Printf("Error: snapshot operation failed. No error message available!\n");397 RTMsgError("Snapshot operation failed. No error message available!"); 398 398 } 399 399 }
Note:
See TracChangeset
for help on using the changeset viewer.