VirtualBox

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

Last change on this file since 74942 was 72949, checked in by vboxsync, 6 years ago

VBoxManage,manual: Added a new command called 'mediumio' to VBoxManage for making use of the IMediumIO interface.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 12.1 KB
RevLine 
[14732]1/* $Id: VBoxManage.h 72949 2018-07-07 16:22:45Z vboxsync $ */
[1]2/** @file
[14732]3 * VBoxManage - VirtualBox command-line interface, internal header file.
[1]4 */
5
6/*
[69500]7 * Copyright (C) 2006-2017 Oracle Corporation
[1]8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
[5999]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.
[1]16 */
17
[5204]18#ifndef ___H_VBOXMANAGE
19#define ___H_VBOXMANAGE
[1]20
[11703]21#ifndef VBOX_ONLY_DOCS
[16054]22#include <VBox/com/com.h>
[5146]23#include <VBox/com/ptr.h>
24#include <VBox/com/VirtualBox.h>
[14555]25#include <VBox/com/string.h>
[42176]26#include <VBox/com/array.h>
[11703]27#endif /* !VBOX_ONLY_DOCS */
[5146]28
[13908]29#include <iprt/types.h>
[32701]30#include <iprt/message.h>
[32709]31#include <iprt/stream.h>
[49621]32#include <iprt/getopt.h>
[13908]33
[56344]34#ifndef VBOX_ONLY_DOCS
35# include "VBoxManageBuiltInHelp.h"
36#endif
[56118]37
[56344]38
[18396]39////////////////////////////////////////////////////////////////////////////////
40//
41// definitions
42//
43////////////////////////////////////////////////////////////////////////////////
44
[5204]45/** @name Syntax diagram category.
46 * @{ */
[1475]47#define USAGE_DUMPOPTS 0
[5605]48#define USAGE_LIST RT_BIT_64(0)
49#define USAGE_SHOWVMINFO RT_BIT_64(1)
50#define USAGE_REGISTERVM RT_BIT_64(2)
51#define USAGE_UNREGISTERVM RT_BIT_64(3)
52#define USAGE_CREATEVM RT_BIT_64(4)
53#define USAGE_MODIFYVM RT_BIT_64(5)
[37074]54#define USAGE_CLONEVM RT_BIT_64(6)
55#define USAGE_STARTVM RT_BIT_64(7)
56#define USAGE_CONTROLVM RT_BIT_64(8)
57#define USAGE_DISCARDSTATE RT_BIT_64(9)
58#define USAGE_SNAPSHOT RT_BIT_64(10)
[18703]59#define USAGE_CLOSEMEDIUM RT_BIT_64(11)
[54438]60#define USAGE_SHOWMEDIUMINFO RT_BIT_64(12)
61#define USAGE_CREATEMEDIUM RT_BIT_64(13)
62#define USAGE_MODIFYMEDIUM RT_BIT_64(14)
63#define USAGE_CLONEMEDIUM RT_BIT_64(15)
[70582]64#define USAGE_MOVEVM RT_BIT_64(16)
[5605]65#define USAGE_CREATEHOSTIF RT_BIT_64(17)
66#define USAGE_REMOVEHOSTIF RT_BIT_64(18)
67#define USAGE_GETEXTRADATA RT_BIT_64(19)
68#define USAGE_SETEXTRADATA RT_BIT_64(20)
69#define USAGE_SETPROPERTY RT_BIT_64(21)
70#define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24))
71#define USAGE_USBFILTER_ADD RT_BIT_64(22)
72#define USAGE_USBFILTER_MODIFY RT_BIT_64(23)
73#define USAGE_USBFILTER_REMOVE RT_BIT_64(24)
74#define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26))
75#define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25)
76#define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26)
[72949]77#define USAGE_UNATTENDED RT_BIT_64(27)
78#define USAGE_MEDIUMIO RT_BIT_64(28)
[5605]79#define USAGE_LOADSYMS RT_BIT_64(29)
[39477]80#define USAGE_LOADMAP RT_BIT_64(30)
[15366]81#define USAGE_SETHDUUID RT_BIT_64(31)
[15602]82#define USAGE_CONVERTFROMRAW RT_BIT_64(32)
[9103]83#define USAGE_LISTPARTITIONS RT_BIT_64(33)
84#define USAGE_CREATERAWVMDK RT_BIT_64(34)
[34971]85#define USAGE_DEBUGVM RT_BIT_64(35)
[5605]86#define USAGE_ADOPTSTATE RT_BIT_64(36)
[5895]87#define USAGE_MODINSTALL RT_BIT_64(37)
88#define USAGE_MODUNINSTALL RT_BIT_64(38)
[9103]89#define USAGE_RENAMEVMDK RT_BIT_64(39)
[10797]90#ifdef VBOX_WITH_GUEST_PROPS
[30319]91# define USAGE_GUESTPROPERTY RT_BIT_64(40)
[10797]92#endif /* VBOX_WITH_GUEST_PROPS defined */
[11066]93#define USAGE_CONVERTTORAW RT_BIT_64(41)
[11384]94#define USAGE_METRICS RT_BIT_64(42)
[15366]95#define USAGE_CONVERTHD RT_BIT_64(43)
[16485]96#define USAGE_IMPORTAPPLIANCE RT_BIT_64(44)
[17033]97#define USAGE_EXPORTAPPLIANCE RT_BIT_64(45)
[17549]98#define USAGE_HOSTONLYIFS RT_BIT_64(46)
[17882]99#define USAGE_DHCPSERVER RT_BIT_64(47)
[21806]100#define USAGE_DUMPHDINFO RT_BIT_64(48)
[23902]101#define USAGE_STORAGEATTACH RT_BIT_64(49)
[23802]102#define USAGE_STORAGECONTROLLER RT_BIT_64(50)
[27703]103#ifdef VBOX_WITH_GUEST_CONTROL
[30319]104# define USAGE_GUESTCONTROL RT_BIT_64(51)
[27703]105#endif /* VBOX_WITH_GUEST_CONTROL defined */
[30319]106#define USAGE_DEBUGLOG RT_BIT_64(52)
[31461]107#define USAGE_SETHDPARENTUUID RT_BIT_64(53)
[33228]108#define USAGE_PASSWORDHASH RT_BIT_64(54)
[34244]109#define USAGE_EXTPACK RT_BIT_64(55)
[34587]110#define USAGE_BANDWIDTHCONTROL RT_BIT_64(56)
[36067]111#define USAGE_GUESTSTATS RT_BIT_64(57)
[39576]112#define USAGE_REPAIRHD RT_BIT_64(58)
[45156]113#define USAGE_NATNETWORK RT_BIT_64(59)
[54438]114#define USAGE_MEDIUMPROPERTY RT_BIT_64(60)
[54487]115#define USAGE_ENCRYPTMEDIUM RT_BIT_64(61)
[54885]116#define USAGE_MEDIUMENCCHKPWD RT_BIT_64(62)
[60089]117#define USAGE_USBDEVSOURCE RT_BIT_64(63)
[1489]118#define USAGE_ALL (~(uint64_t)0)
[5204]119/** @} */
[1]120
[49621]121#ifdef VBOX_WITH_GUEST_CONTROL
[55535]122# define USAGE_GSTCTRL_RUN RT_BIT(0)
123# define USAGE_GSTCTRL_START RT_BIT(1)
124# define USAGE_GSTCTRL_COPYFROM RT_BIT(2)
125# define USAGE_GSTCTRL_COPYTO RT_BIT(3)
[55604]126# define USAGE_GSTCTRL_MKDIR RT_BIT(4)
127# define USAGE_GSTCTRL_RMDIR RT_BIT(5)
128# define USAGE_GSTCTRL_RM RT_BIT(6)
129# define USAGE_GSTCTRL_MV RT_BIT(7)
130# define USAGE_GSTCTRL_MKTEMP RT_BIT(8)
[55535]131# define USAGE_GSTCTRL_LIST RT_BIT(9)
[55604]132# define USAGE_GSTCTRL_CLOSEPROCESS RT_BIT(10)
133# define USAGE_GSTCTRL_CLOSESESSION RT_BIT(11)
134# define USAGE_GSTCTRL_STAT RT_BIT(12)
135# define USAGE_GSTCTRL_UPDATEGA RT_BIT(13)
136# define USAGE_GSTCTRL_WATCH RT_BIT(14)
[49621]137#endif
138
[64997]139
[1475]140typedef uint64_t USAGECATEGORY;
141
[16052]142/** command handler argument */
143struct HandlerArg
144{
145 int argc;
146 char **argv;
[17079]147
[16057]148#ifndef VBOX_ONLY_DOCS
[16052]149 ComPtr<IVirtualBox> virtualBox;
150 ComPtr<ISession> session;
[16057]151#endif
[16052]152};
153
[1]154/** flag whether we're in internal mode */
[5204]155extern bool g_fInternalMode;
[1]156
[4649]157/** showVMInfo details */
158typedef enum
159{
[4779]160 VMINFO_NONE = 0,
[5204]161 VMINFO_STANDARD = 1, /**< standard details */
[27822]162 VMINFO_FULL = 2, /**< both */
163 VMINFO_MACHINEREADABLE = 3, /**< both, and make it machine readable */
164 VMINFO_COMPACT = 4
[4649]165} VMINFO_DETAILS;
166
[56118]167
[18396]168////////////////////////////////////////////////////////////////////////////////
169//
170// global variables
171//
172////////////////////////////////////////////////////////////////////////////////
[16052]173
[18396]174extern bool g_fDetailedProgress; // in VBoxManage.cpp
175
[56118]176
[18396]177////////////////////////////////////////////////////////////////////////////////
178//
179// prototypes
180//
181////////////////////////////////////////////////////////////////////////////////
182
[17103]183/* VBoxManageHelp.cpp */
[49621]184void printUsage(USAGECATEGORY fCategory, uint32_t fSubCategory, PRTSTREAM pStrm);
185RTEXITCODE errorSyntax(USAGECATEGORY fCategory, const char *pszFormat, ...);
186RTEXITCODE errorSyntaxEx(USAGECATEGORY fCategory, uint32_t fSubCategory, const char *pszFormat, ...);
187RTEXITCODE errorGetOpt(USAGECATEGORY fCategory, int rc, union RTGETOPTUNION const *pValueUnion);
188RTEXITCODE errorGetOptEx(USAGECATEGORY fCategory, uint32_t fSubCategory, int rc, union RTGETOPTUNION const *pValueUnion);
[33764]189RTEXITCODE errorArgument(const char *pszFormat, ...);
[1]190
[49621]191void printUsageInternal(USAGECATEGORY fCategory, PRTSTREAM pStrm);
[15492]192
[15499]193#ifndef VBOX_ONLY_DOCS
[56344]194void setCurrentCommand(enum HELP_CMD_VBOXMANAGE enmCommand);
195void setCurrentSubcommand(uint64_t fCurSubcommandScope);
196
[56349]197void printUsage(PRTSTREAM pStrm);
198void printHelp(PRTSTREAM pStrm);
[56344]199RTEXITCODE errorNoSubcommand(void);
200RTEXITCODE errorUnknownSubcommand(const char *pszSubCmd);
[56349]201RTEXITCODE errorTooManyParameters(char **papszArgs);
[56344]202RTEXITCODE errorGetOpt(int rcGetOpt, union RTGETOPTUNION const *pValueUnion);
203RTEXITCODE errorSyntax(const char *pszFormat, ...);
204
[24879]205HRESULT showProgress(ComPtr<IProgress> progress);
[17103]206#endif
[15492]207
[17103]208/* VBoxManage.cpp */
[32709]209void showLogo(PRTSTREAM pStrm);
[17103]210
211#ifndef VBOX_ONLY_DOCS
[42444]212RTEXITCODE readPasswordFile(const char *pszFilename, com::Utf8Str *pPasswd);
[55182]213RTEXITCODE readPasswordFromConsole(com::Utf8Str *pPassword, const char *pszPrompt, ...);
[42444]214
[56118]215RTEXITCODE handleInternalCommands(HandlerArg *a);
[11703]216#endif /* !VBOX_ONLY_DOCS */
[14555]217
[24903]218/* VBoxManageControlVM.cpp */
[56118]219RTEXITCODE handleControlVM(HandlerArg *a);
[35766]220#ifndef VBOX_ONLY_DOCS
[35764]221unsigned int getMaxNics(IVirtualBox* vbox, IMachine* mach);
[35766]222#endif
[24903]223
[16485]224/* VBoxManageModifyVM.cpp */
[42176]225#ifndef VBOX_ONLY_DOCS
226void parseGroups(const char *pcszGroups, com::SafeArray<BSTR> *pGroups);
227#endif
[56118]228RTEXITCODE handleModifyVM(HandlerArg *a);
[16485]229
[34913]230/* VBoxManageDebugVM.cpp */
[56118]231RTEXITCODE handleDebugVM(HandlerArg *a);
[34913]232
[14555]233/* VBoxManageGuestProp.cpp */
[42460]234extern void usageGuestProperty(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2);
[32712]235
236/* VBoxManageGuestCtrl.cpp */
[49621]237extern void usageGuestControl(PRTSTREAM pStrm, const char *pcszSep1, const char *pcszSep2, uint32_t fSubCategory);
[32712]238
[11703]239#ifndef VBOX_ONLY_DOCS
[32712]240/* VBoxManageGuestProp.cpp */
[56118]241RTEXITCODE handleGuestProperty(HandlerArg *a);
[14555]242
[27703]243/* VBoxManageGuestCtrl.cpp */
[56118]244RTEXITCODE handleGuestControl(HandlerArg *a);
[27703]245
[14612]246/* VBoxManageVMInfo.cpp */
[39119]247HRESULT showSnapshots(ComPtr<ISnapshot> &rootSnapshot,
248 ComPtr<ISnapshot> &currentSnapshot,
249 VMINFO_DETAILS details,
[44028]250 const com::Utf8Str &prefix = "",
[39119]251 int level = 0);
[56118]252RTEXITCODE handleShowVMInfo(HandlerArg *a);
[53266]253HRESULT showVMInfo(ComPtr<IVirtualBox> pVirtualBox,
254 ComPtr<IMachine> pMachine,
255 ComPtr<ISession> pSession,
256 VMINFO_DETAILS details = VMINFO_NONE);
[35907]257const char *machineStateToName(MachineState_T machineState, bool fShort);
[40470]258HRESULT showBandwidthGroups(ComPtr<IBandwidthControl> &bwCtrl,
259 VMINFO_DETAILS details);
[14612]260
261/* VBoxManageList.cpp */
[56118]262RTEXITCODE handleList(HandlerArg *a);
[14555]263
[14646]264/* VBoxManageMetrics.cpp */
[56118]265RTEXITCODE handleMetrics(HandlerArg *a);
[14646]266
[24907]267/* VBoxManageMisc.cpp */
[56118]268RTEXITCODE handleRegisterVM(HandlerArg *a);
269RTEXITCODE handleUnregisterVM(HandlerArg *a);
270RTEXITCODE handleCreateVM(HandlerArg *a);
271RTEXITCODE handleCloneVM(HandlerArg *a);
272RTEXITCODE handleStartVM(HandlerArg *a);
273RTEXITCODE handleDiscardState(HandlerArg *a);
274RTEXITCODE handleAdoptState(HandlerArg *a);
275RTEXITCODE handleGetExtraData(HandlerArg *a);
276RTEXITCODE handleSetExtraData(HandlerArg *a);
277RTEXITCODE handleSetProperty(HandlerArg *a);
278RTEXITCODE handleSharedFolder(HandlerArg *a);
279RTEXITCODE handleExtPack(HandlerArg *a);
[68140]280RTEXITCODE handleUnattended(HandlerArg *a);
[70582]281RTEXITCODE handleMoveVM(HandlerArg *a);
[24907]282
[15492]283/* VBoxManageDisk.cpp */
[44028]284HRESULT openMedium(HandlerArg *a, const char *pszFilenameOrUuid,
285 DeviceType_T enmDevType, AccessMode_T enmAccessMode,
286 ComPtr<IMedium> &pMedium, bool fForceNewUuidOnOpen,
287 bool fSilent);
[56118]288RTEXITCODE handleCreateMedium(HandlerArg *a);
289RTEXITCODE handleModifyMedium(HandlerArg *a);
290RTEXITCODE handleCloneMedium(HandlerArg *a);
291RTEXITCODE handleMediumProperty(HandlerArg *a);
292RTEXITCODE handleEncryptMedium(HandlerArg *a);
293RTEXITCODE handleCheckMediumPassword(HandlerArg *a);
294RTEXITCODE handleConvertFromRaw(HandlerArg *a);
[44498]295HRESULT showMediumInfo(const ComPtr<IVirtualBox> &pVirtualBox,
296 const ComPtr<IMedium> &pMedium,
297 const char *pszParentUUID,
298 bool fOptLong);
[56118]299RTEXITCODE handleShowMediumInfo(HandlerArg *a);
300RTEXITCODE handleCloseMedium(HandlerArg *a);
[72949]301RTEXITCODE handleMediumIO(HandlerArg *a);
[54438]302int parseMediumType(const char *psz, MediumType_T *penmMediumType);
[42248]303int parseBool(const char *psz, bool *pb);
[15492]304
[23802]305/* VBoxManageStorageController.cpp */
[56118]306RTEXITCODE handleStorageAttach(HandlerArg *a);
307RTEXITCODE handleStorageController(HandlerArg *a);
[23802]308
[16485]309// VBoxManageImport.cpp
[56118]310RTEXITCODE handleImportAppliance(HandlerArg *a);
311RTEXITCODE handleExportAppliance(HandlerArg *a);
[16485]312
[17102]313// VBoxManageSnapshot.cpp
[56118]314RTEXITCODE handleSnapshot(HandlerArg *a);
[17102]315
[14555]316/* VBoxManageUSB.cpp */
[56118]317RTEXITCODE handleUSBFilter(HandlerArg *a);
[60089]318RTEXITCODE handleUSBDevSource(HandlerArg *a);
[14555]319
[17419]320/* VBoxManageHostonly.cpp */
[56118]321RTEXITCODE handleHostonlyIf(HandlerArg *a);
[17419]322
[45156]323/* VBoxManageDHCPServer.cpp */
[56118]324RTEXITCODE handleDHCPServer(HandlerArg *a);
[17882]325
[45156]326/* VBoxManageNATNetwork.cpp */
[56118]327RTEXITCODE handleNATNetwork(HandlerArg *a);
[45156]328
329
[34587]330/* VBoxManageBandwidthControl.cpp */
[56118]331RTEXITCODE handleBandwidthControl(HandlerArg *a);
[34587]332
[11703]333#endif /* !VBOX_ONLY_DOCS */
[1]334
[5204]335#endif /* !___H_VBOXMANAGE */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use