VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h@ 34587

最後變更 在這個檔案從34587是 34587,由 vboxsync 提交於 14 年 前

Main: Bandwidth groups for disks (and later network)

This introduces two new interfaces. The first one named IBandwidthGroup
represents one I/O limit and can be assigned to several mediums which
share this limit (which works only for harddisk images with the disabled
host cache).
The second one IBandwdithControl manages the groups and can create new ones
and destroy them if not required anymore.

VBoxManage: commands to access the bandwidth groups

Syntax:
VBoxManage storageattach <uuid|vmname>

...
--bandwidthgroup <name>

--bandwidthgroup assigns the specified device to the given group.

VBoxManage bandwidthctl <uuid|vmname>

--name <name>
--add disk|network
--limit <megabytes per second>
--delete

The --name parameter gives the name of the bandwidth group.
--add creates a new group of the given type (only disk is implemented so far)

with the given name.

--limit sets the limit to the given amount of MB/s

Note that limit can be changed while the VM is running. The VM
will immediately pick up the new limit for the given group name.

--delete deletes the group with the given name if it isn't used anymore.

Trying to delete a still used group will result in an error.

Example:

VBoxManage bandwidthctl "Test VM" --name Limit --add disk --limit 20
Creates a group named Test having a 20 MB/s limit.

VBoxManage storageattach "Test VM" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium test.vdi --bandwidthgroup Limit
Adds a new disk to the SATA controller and assigns the bandwidth group Limit to it.

VBoxManage storageattach "Test VM" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium test.vdi --bandwidthgroup none
Removes the bandwidth limit from the disk.

VBoxManage bandwidthctl "Test VM" --name Limit --add disk --limit 10
Changes the limit of bandwidth group Limit to 10 MB/s. If the VM is running the limit will be picked up
immediately.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 8.2 KB
 
1/* $Id: VBoxManage.h 34587 2010-12-01 20:30:02Z vboxsync $ */
2/** @file
3 * VBoxManage - VirtualBox command-line interface, internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___H_VBOXMANAGE
19#define ___H_VBOXMANAGE
20
21#ifndef VBOX_ONLY_DOCS
22#include <VBox/com/com.h>
23#include <VBox/com/ptr.h>
24#include <VBox/com/VirtualBox.h>
25#include <VBox/com/string.h>
26#endif /* !VBOX_ONLY_DOCS */
27
28#include <iprt/types.h>
29#include <iprt/message.h>
30#include <iprt/stream.h>
31
32////////////////////////////////////////////////////////////////////////////////
33//
34// definitions
35//
36////////////////////////////////////////////////////////////////////////////////
37
38/** @name Syntax diagram category.
39 * @{ */
40#define USAGE_DUMPOPTS 0
41#define USAGE_LIST RT_BIT_64(0)
42#define USAGE_SHOWVMINFO RT_BIT_64(1)
43#define USAGE_REGISTERVM RT_BIT_64(2)
44#define USAGE_UNREGISTERVM RT_BIT_64(3)
45#define USAGE_CREATEVM RT_BIT_64(4)
46#define USAGE_MODIFYVM RT_BIT_64(5)
47#define USAGE_STARTVM RT_BIT_64(6)
48#define USAGE_CONTROLVM RT_BIT_64(7)
49#define USAGE_DISCARDSTATE RT_BIT_64(8)
50#define USAGE_SNAPSHOT RT_BIT_64(9)
51#define USAGE_CLOSEMEDIUM RT_BIT_64(11)
52#define USAGE_SHOWHDINFO RT_BIT_64(12)
53#define USAGE_CREATEHD RT_BIT_64(13)
54#define USAGE_MODIFYHD RT_BIT_64(14)
55#define USAGE_CLONEHD RT_BIT_64(15)
56#define USAGE_ADDISCSIDISK RT_BIT_64(16)
57#define USAGE_CREATEHOSTIF RT_BIT_64(17)
58#define USAGE_REMOVEHOSTIF RT_BIT_64(18)
59#define USAGE_GETEXTRADATA RT_BIT_64(19)
60#define USAGE_SETEXTRADATA RT_BIT_64(20)
61#define USAGE_SETPROPERTY RT_BIT_64(21)
62#define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24))
63#define USAGE_USBFILTER_ADD RT_BIT_64(22)
64#define USAGE_USBFILTER_MODIFY RT_BIT_64(23)
65#define USAGE_USBFILTER_REMOVE RT_BIT_64(24)
66#define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26))
67#define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25)
68#define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26)
69#define USAGE_LOADSYMS RT_BIT_64(29)
70#define USAGE_UNLOADSYMS RT_BIT_64(30)
71#define USAGE_SETHDUUID RT_BIT_64(31)
72#define USAGE_CONVERTFROMRAW RT_BIT_64(32)
73#define USAGE_LISTPARTITIONS RT_BIT_64(33)
74#define USAGE_CREATERAWVMDK RT_BIT_64(34)
75#define USAGE_VM_STATISTICS RT_BIT_64(35)
76#define USAGE_ADOPTSTATE RT_BIT_64(36)
77#define USAGE_MODINSTALL RT_BIT_64(37)
78#define USAGE_MODUNINSTALL RT_BIT_64(38)
79#define USAGE_RENAMEVMDK RT_BIT_64(39)
80#ifdef VBOX_WITH_GUEST_PROPS
81# define USAGE_GUESTPROPERTY RT_BIT_64(40)
82#endif /* VBOX_WITH_GUEST_PROPS defined */
83#define USAGE_CONVERTTORAW RT_BIT_64(41)
84#define USAGE_METRICS RT_BIT_64(42)
85#define USAGE_CONVERTHD RT_BIT_64(43)
86#define USAGE_IMPORTAPPLIANCE RT_BIT_64(44)
87#define USAGE_EXPORTAPPLIANCE RT_BIT_64(45)
88#define USAGE_HOSTONLYIFS RT_BIT_64(46)
89#define USAGE_DHCPSERVER RT_BIT_64(47)
90#define USAGE_DUMPHDINFO RT_BIT_64(48)
91#define USAGE_STORAGEATTACH RT_BIT_64(49)
92#define USAGE_STORAGECONTROLLER RT_BIT_64(50)
93#ifdef VBOX_WITH_GUEST_CONTROL
94# define USAGE_GUESTCONTROL RT_BIT_64(51)
95#endif /* VBOX_WITH_GUEST_CONTROL defined */
96#define USAGE_DEBUGLOG RT_BIT_64(52)
97#define USAGE_SETHDPARENTUUID RT_BIT_64(53)
98#define USAGE_PASSWORDHASH RT_BIT_64(54)
99#define USAGE_EXTPACK RT_BIT_64(55)
100#define USAGE_BANDWIDTHCONTROL RT_BIT_64(56)
101#define USAGE_ALL (~(uint64_t)0)
102/** @} */
103
104typedef uint64_t USAGECATEGORY;
105
106/** command handler argument */
107struct HandlerArg
108{
109 int argc;
110 char **argv;
111
112#ifndef VBOX_ONLY_DOCS
113 ComPtr<IVirtualBox> virtualBox;
114 ComPtr<ISession> session;
115#endif
116};
117
118/** flag whether we're in internal mode */
119extern bool g_fInternalMode;
120
121/** showVMInfo details */
122typedef enum
123{
124 VMINFO_NONE = 0,
125 VMINFO_STANDARD = 1, /**< standard details */
126 VMINFO_FULL = 2, /**< both */
127 VMINFO_MACHINEREADABLE = 3, /**< both, and make it machine readable */
128 VMINFO_COMPACT = 4
129} VMINFO_DETAILS;
130
131////////////////////////////////////////////////////////////////////////////////
132//
133// global variables
134//
135////////////////////////////////////////////////////////////////////////////////
136
137extern bool g_fDetailedProgress; // in VBoxManage.cpp
138
139////////////////////////////////////////////////////////////////////////////////
140//
141// prototypes
142//
143////////////////////////////////////////////////////////////////////////////////
144
145/* VBoxManageHelp.cpp */
146void printUsage(USAGECATEGORY u64Cmd, PRTSTREAM pStrm);
147RTEXITCODE errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...);
148RTEXITCODE errorGetOpt(USAGECATEGORY u64Cmd, int rc, union RTGETOPTUNION const *pValueUnion);
149RTEXITCODE errorArgument(const char *pszFormat, ...);
150
151void printUsageInternal(USAGECATEGORY u64Cmd, PRTSTREAM pStrm);
152
153#ifndef VBOX_ONLY_DOCS
154HRESULT showProgress(ComPtr<IProgress> progress);
155#endif
156
157/* VBoxManage.cpp */
158void showLogo(PRTSTREAM pStrm);
159
160#ifndef VBOX_ONLY_DOCS
161int handleInternalCommands(HandlerArg *a);
162#endif /* !VBOX_ONLY_DOCS */
163
164/* VBoxManageControlVM.cpp */
165int handleControlVM(HandlerArg *a);
166
167/* VBoxManageModifyVM.cpp */
168int handleModifyVM(HandlerArg *a);
169
170/* VBoxManageGuestProp.cpp */
171extern void usageGuestProperty(PRTSTREAM pStrm);
172
173/* VBoxManageGuestCtrl.cpp */
174extern void usageGuestControl(PRTSTREAM pStrm);
175
176#ifndef VBOX_ONLY_DOCS
177/* VBoxManageGuestProp.cpp */
178extern int handleGuestProperty(HandlerArg *a);
179
180/* VBoxManageGuestCtrl.cpp */
181extern int handleGuestControl(HandlerArg *a);
182
183/* VBoxManageVMInfo.cpp */
184void showSnapshots(ComPtr<ISnapshot> &rootSnapshot,
185 ComPtr<ISnapshot> &currentSnapshot,
186 VMINFO_DETAILS details,
187 const com::Bstr &prefix = "",
188 int level = 0);
189int handleShowVMInfo(HandlerArg *a);
190HRESULT showVMInfo(ComPtr<IVirtualBox> virtualBox,
191 ComPtr<IMachine> machine,
192 VMINFO_DETAILS details = VMINFO_NONE,
193 ComPtr <IConsole> console = ComPtr<IConsole>());
194
195/* VBoxManageList.cpp */
196int handleList(HandlerArg *a);
197
198/* VBoxManageMetrics.cpp */
199int handleMetrics(HandlerArg *a);
200
201/* VBoxManageMisc.cpp */
202int handleRegisterVM(HandlerArg *a);
203int handleUnregisterVM(HandlerArg *a);
204int handleCreateVM(HandlerArg *a);
205int handleStartVM(HandlerArg *a);
206int handleDiscardState(HandlerArg *a);
207int handleAdoptState(HandlerArg *a);
208int handleGetExtraData(HandlerArg *a);
209int handleSetExtraData(HandlerArg *a);
210int handleSetProperty(HandlerArg *a);
211int handleSharedFolder(HandlerArg *a);
212int handleVMStatistics(HandlerArg *a);
213int handleExtPack(HandlerArg *a);
214
215/* VBoxManageDisk.cpp */
216int handleCreateHardDisk(HandlerArg *a);
217int handleModifyHardDisk(HandlerArg *a);
218int handleCloneHardDisk(HandlerArg *a);
219RTEXITCODE handleConvertFromRaw(int argc, char *argv[]);
220int handleAddiSCSIDisk(HandlerArg *a);
221int handleShowHardDiskInfo(HandlerArg *a);
222int handleCloseMedium(HandlerArg *a);
223
224/* VBoxManageStorageController.cpp */
225int handleStorageAttach(HandlerArg *a);
226int handleStorageController(HandlerArg *a);
227
228// VBoxManageImport.cpp
229int handleImportAppliance(HandlerArg *a);
230int handleExportAppliance(HandlerArg *a);
231
232// VBoxManageSnapshot.cpp
233int handleSnapshot(HandlerArg *a);
234
235/* VBoxManageUSB.cpp */
236int handleUSBFilter(HandlerArg *a);
237
238/* VBoxManageHostonly.cpp */
239int handleHostonlyIf(HandlerArg *a);
240
241/* VBoxManageHostonly.cpp */
242int handleDHCPServer(HandlerArg *a);
243
244/* VBoxManageBandwidthControl.cpp */
245int handleBandwidthControl(HandlerArg *a);
246
247#endif /* !VBOX_ONLY_DOCS */
248
249#endif /* !___H_VBOXMANAGE */
250
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette