Changeset 5204 in vbox
- Timestamp:
- Oct 9, 2007 1:54:46 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 25131
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r4071 r5204 51 51 52 52 /** flag whether we're in internal mode */ 53 bool fInternalMode;53 bool g_fInternalMode; 54 54 55 55 /** … … 400 400 ComPtr <IVirtualBox> aVirtualBox, ComPtr<ISession> aSession) 401 401 { 402 fInternalMode = true;402 g_fInternalMode = true; 403 403 404 404 /* at least a command is required */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r5201 r5204 596 596 "\n"); 597 597 } 598 599 if (u64Cmd & USAGE_VM_STATISTICS) 600 { 601 RTPrintf("VBoxManage vmstatistics <vmname>|<uuid>\n" 602 " [-pattern <pattern>] [-descriptions]\n" 603 "\n"); 604 } 598 605 } 599 606 … … 605 612 va_list args; 606 613 showLogo(); // show logo even if suppressed 607 if ( fInternalMode)614 if (g_fInternalMode) 608 615 printUsageInternal(u64Cmd); 609 616 else … … 4794 4801 u32LineSpeed = atoi(nicspeed[n]); 4795 4802 4796 if (u32LineSpeed < 1000 || u32LineSpeed > 4000000) 4803 if (u32LineSpeed < 1000 || u32LineSpeed > 4000000) 4797 4804 { 4798 4805 errorArgument("Invalid -nicspeed%lu argument '%s'", n + 1, nicspeed[n]); 4799 4806 rc = E_FAIL; 4800 4807 break; 4801 } 4802 else 4803 { 4804 CHECK_ERROR_RET(nic, COMSETTER(LineSpeed)(u32LineSpeed), 1); 4805 } 4808 } 4809 CHECK_ERROR_RET(nic, COMSETTER(LineSpeed)(u32LineSpeed), 1); 4806 4810 } 4807 4811 … … 6999 7003 } 7000 7004 return 0; 7005 } 7006 7007 static int handleVMStatistics(int argc, char *argv[], 7008 ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession) 7009 { 7010 HRESULT rc; 7011 7012 /* at least one option: the UUID or name of the VM */ 7013 if (argc < 1) 7014 return errorSyntax(USAGE_VM_STATISTICS, "Incorrect number of parameters"); 7015 7016 /* try to find the given machine */ 7017 ComPtr <IMachine> machine; 7018 Guid uuid (argv[0]); 7019 if (!uuid.isEmpty()) 7020 CHECK_ERROR(aVirtualBox, GetMachine(uuid, machine.asOutParam())); 7021 else 7022 { 7023 CHECK_ERROR(aVirtualBox, FindMachine(Bstr(argv[0]), machine.asOutParam())); 7024 if (SUCCEEDED (rc)) 7025 machine->COMGETTER(Id)(uuid.asOutParam()); 7026 } 7027 if (FAILED(rc)) 7028 return 1; 7029 7030 /* */ 7031 bool fWithDescriptions = false; 7032 const char *pszPattern = NULL; /* all */ 7033 for (int i = 1; i < argc; i++) 7034 { 7035 if (!strcmp(argv[i], "-pattern")) 7036 { 7037 if (pszPattern) 7038 return errorSyntax(USAGE_VM_STATISTICS, "Multiple -patterns options is not permitted"); 7039 if (i + 1 >= argc) 7040 return errorArgument("Missing argument to '%s'", argv[i]); 7041 pszPattern = argv[++i]; 7042 } 7043 else if (!strcmp(argv[i], "-descriptions")) 7044 fWithDescriptions = true; 7045 /* add: -file <filename> and -formatted */ 7046 else 7047 return errorSyntax(USAGE_VM_STATISTICS, "Unknown option '%s'", argv[i]); 7048 } 7049 7050 /* open an existing session for the VM. */ 7051 CHECK_ERROR(aVirtualBox, OpenExistingSession(aSession, uuid)); 7052 if (SUCCEEDED(rc)) 7053 { 7054 /* get the session console. */ 7055 ComPtr <IConsole> console; 7056 CHECK_ERROR(aSession, COMGETTER(Console)(console.asOutParam())); 7057 if (SUCCEEDED(rc)) 7058 { 7059 /* get the machine debugger. */ 7060 ComPtr <IMachineDebugger> debugger; 7061 CHECK_ERROR(console, COMGETTER(Debugger)(debugger.asOutParam())); 7062 if (SUCCEEDED(rc)) 7063 { 7064 if (1/*fDumpStats*/) 7065 { 7066 Bstr stats; 7067 CHECK_ERROR(debugger, GetStats(Bstr(pszPattern).raw(), fWithDescriptions, stats.asOutParam())); 7068 if (SUCCEEDED(rc)) 7069 { 7070 RTPrintf("%ls\n", stats.raw()); 7071 } 7072 } 7073 } 7074 aSession->Close(); 7075 } 7076 } 7077 7078 return SUCCEEDED(rc) ? 0 : 1; 7001 7079 } 7002 7080 … … 7388 7466 { "usbfilter", handleUSBFilter }, 7389 7467 { "sharedfolder", handleSharedFolder }, 7468 { "vmstatistics", handleVMStatistics }, 7390 7469 { NULL, NULL } 7391 7470 }; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r5146 r5204 1 1 /** @file 2 *3 2 * VBox frontends: VBoxManage (command-line interface): 4 3 * VBoxManage header. … … 17 16 */ 18 17 19 #ifndef __ H_VBOXMANAGE20 #define __ H_VBOXMANAGE18 #ifndef ___H_VBOXMANAGE 19 #define ___H_VBOXMANAGE 21 20 22 21 #include <iprt/types.h> … … 24 23 #include <VBox/com/VirtualBox.h> 25 24 26 /** Syntax diagram category. */ 25 /** @name Syntax diagram category. 26 * @{ */ 27 27 #define USAGE_DUMPOPTS 0 28 28 #define USAGE_LIST BIT64(0) … … 61 61 #define USAGE_CONVERTDD BIT64(32) 62 62 #ifdef VBOX_OSE 63 # define USAGE_LISTPARTITIONS(0)64 # define USAGE_CREATERAWVMDK(0)63 # define USAGE_LISTPARTITIONS (0) 64 # define USAGE_CREATERAWVMDK (0) 65 65 #else /* !VBOX_OSE */ 66 # define USAGE_LISTPARTITIONSBIT64(33)67 # define USAGE_CREATERAWVMDKBIT64(34)66 # define USAGE_LISTPARTITIONS BIT64(33) 67 # define USAGE_CREATERAWVMDK BIT64(34) 68 68 #endif /* !VBOX_OSE */ 69 #define USAGE_VM_STATISTICS BIT64(35) 69 70 #define USAGE_ALL (~(uint64_t)0) 71 /** @} */ 70 72 71 73 typedef uint64_t USAGECATEGORY; 72 74 73 75 /** flag whether we're in internal mode */ 74 extern bool fInternalMode;76 extern bool g_fInternalMode; 75 77 76 78 /** showVMInfo details */ … … 78 80 { 79 81 VMINFO_NONE = 0, 80 VMINFO_STANDARD = 1, /* standard details */81 VMINFO_STATISTICS = 2, /* guest statistics */82 VMINFO_FULL = 3, /* both */83 VMINFO_MACHINEREADABLE = 4 , /*both, and make it machine readable */82 VMINFO_STANDARD = 1, /**< standard details */ 83 VMINFO_STATISTICS = 2, /**< guest statistics */ 84 VMINFO_FULL = 3, /**< both */ 85 VMINFO_MACHINEREADABLE = 4 /**< both, and make it machine readable */ 84 86 } VMINFO_DETAILS; 85 87 … … 93 95 int handleInternalCommands(int argc, char *argv[], 94 96 ComPtr <IVirtualBox> aVirtualBox, ComPtr<ISession> aSession); 95 unsigned long VBoxSVNRev 97 unsigned long VBoxSVNRev(); 96 98 97 #endif /* !__ H_VBOXMANAGE */99 #endif /* !___H_VBOXMANAGE */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSVN.cpp
r5146 r5204 1 /* $Id$ */ 1 2 /** @file 2 *3 3 * VBox frontends: VBoxManage (command-line interface): 4 4 * SVN revision. … … 26 26 * the version number is requested. 27 27 */ 28 unsigned long VBoxSVNRev 28 unsigned long VBoxSVNRev() 29 29 { 30 30 return VBOX_SVN_REV; 31 31 } 32
Note:
See TracChangeset
for help on using the changeset viewer.