VirtualBox

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

Last change on this file since 15935 was 15602, checked in by vboxsync, 16 years ago

VBoxManage: move converthd back to internalcommands, and a few minor cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.8 KB
Line 
1/* $Id: VBoxManage.h 15602 2008-12-16 18:01:38Z vboxsync $ */
2/** @file
3 * VBoxManage - VirtualBox command-line interface, internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ___H_VBOXMANAGE
23#define ___H_VBOXMANAGE
24
25#ifndef VBOX_ONLY_DOCS
26#include <VBox/com/ptr.h>
27#include <VBox/com/VirtualBox.h>
28#include <VBox/com/EventQueue.h>
29#include <VBox/com/string.h>
30#endif /* !VBOX_ONLY_DOCS */
31
32#include <iprt/types.h>
33
34#if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
35# define USE_XPCOM_QUEUE
36#endif
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_REGISTERIMAGE RT_BIT_64(10)
52#define USAGE_UNREGISTERIMAGE RT_BIT_64(11)
53#define USAGE_SHOWHDINFO RT_BIT_64(12)
54#define USAGE_CREATEHD RT_BIT_64(13)
55#define USAGE_MODIFYHD RT_BIT_64(14)
56#define USAGE_CLONEHD RT_BIT_64(15)
57#define USAGE_ADDISCSIDISK RT_BIT_64(16)
58#define USAGE_CREATEHOSTIF RT_BIT_64(17)
59#define USAGE_REMOVEHOSTIF RT_BIT_64(18)
60#define USAGE_GETEXTRADATA RT_BIT_64(19)
61#define USAGE_SETEXTRADATA RT_BIT_64(20)
62#define USAGE_SETPROPERTY RT_BIT_64(21)
63#define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24))
64#define USAGE_USBFILTER_ADD RT_BIT_64(22)
65#define USAGE_USBFILTER_MODIFY RT_BIT_64(23)
66#define USAGE_USBFILTER_REMOVE RT_BIT_64(24)
67#define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26))
68#define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25)
69#define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26)
70#define USAGE_LOADSYMS RT_BIT_64(29)
71#define USAGE_UNLOADSYMS RT_BIT_64(30)
72#define USAGE_SETHDUUID RT_BIT_64(31)
73#define USAGE_CONVERTFROMRAW RT_BIT_64(32)
74#define USAGE_LISTPARTITIONS RT_BIT_64(33)
75#define USAGE_CREATERAWVMDK RT_BIT_64(34)
76#define USAGE_VM_STATISTICS RT_BIT_64(35)
77#define USAGE_ADOPTSTATE RT_BIT_64(36)
78#define USAGE_MODINSTALL RT_BIT_64(37)
79#define USAGE_MODUNINSTALL RT_BIT_64(38)
80#define USAGE_RENAMEVMDK RT_BIT_64(39)
81#ifdef VBOX_WITH_GUEST_PROPS
82#define USAGE_GUESTPROPERTY RT_BIT_64(40)
83#endif /* VBOX_WITH_GUEST_PROPS defined */
84#define USAGE_CONVERTTORAW RT_BIT_64(41)
85#define USAGE_METRICS RT_BIT_64(42)
86#define USAGE_CONVERTHD RT_BIT_64(43)
87#define USAGE_ALL (~(uint64_t)0)
88/** @} */
89
90typedef uint64_t USAGECATEGORY;
91
92/** flag whether we're in internal mode */
93extern bool g_fInternalMode;
94
95#ifndef VBOX_ONLY_DOCS
96# ifdef USE_XPCOM_QUEUE
97/** A pointer to the event queue, set by main() before calling any handlers. */
98extern nsCOMPtr<nsIEventQueue> g_pEventQ;
99# endif
100#endif /* !VBOX_ONLY_DOCS */
101
102/** showVMInfo details */
103typedef enum
104{
105 VMINFO_NONE = 0,
106 VMINFO_STANDARD = 1, /**< standard details */
107 VMINFO_STATISTICS = 2, /**< guest statistics */
108 VMINFO_FULL = 3, /**< both */
109 VMINFO_MACHINEREADABLE = 4 /**< both, and make it machine readable */
110} VMINFO_DETAILS;
111
112/*
113 * Prototypes
114 */
115/* VBoxManage.cpp */
116int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...);
117int errorArgument(const char *pszFormat, ...);
118
119void printUsageInternal(USAGECATEGORY u64Cmd);
120
121#ifndef VBOX_ONLY_DOCS
122void showProgress(ComPtr<IProgress> progress);
123
124int handleInternalCommands(int argc, char *argv[],
125 ComPtr <IVirtualBox> aVirtualBox, ComPtr<ISession> aSession);
126#endif /* !VBOX_ONLY_DOCS */
127
128/* VBoxManageGuestProp.cpp */
129extern void usageGuestProperty(void);
130#ifndef VBOX_ONLY_DOCS
131extern int handleGuestProperty(int argc, char *argv[],
132 ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession);
133
134/* VBoxManageVMInfo.cpp */
135void showSnapshots(ComPtr<ISnapshot> rootSnapshot, VMINFO_DETAILS details, const com::Bstr &prefix = "", int level = 0);
136int handleShowVMInfo(int argc, char *argv[],
137 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
138HRESULT showVMInfo(ComPtr <IVirtualBox> virtualBox, ComPtr<IMachine> machine,
139 ComPtr <IConsole> console = ComPtr <IConsole> (),
140 VMINFO_DETAILS details = VMINFO_NONE);
141
142/* VBoxManageList.cpp */
143int handleList(int argc, char *argv[],
144 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
145
146/* VBoxManageMetrics.cpp */
147int handleMetrics(int argc, char *argv[],
148 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
149
150/* VBoxManageDisk.cpp */
151int handleCreateHardDisk(int argc, char *argv[],
152 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
153int handleModifyHardDisk(int argc, char *argv[],
154 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
155int handleCloneHardDisk(int argc, char *argv[],
156 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
157int handleConvertHardDisk(int argc, char **argv);
158int handleConvertFromRaw(int argc, char *argv[]);
159int handleAddiSCSIDisk(int argc, char *argv[],
160 ComPtr <IVirtualBox> aVirtualBox, ComPtr<ISession> aSession);
161int handleShowHardDiskInfo(int argc, char *argv[],
162 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
163int handleOpenMedium(int argc, char *argv[],
164 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
165int handleCloseMedium(int argc, char *argv[],
166 ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session);
167
168/* VBoxManageUSB.cpp */
169/* VBoxManageTODO.cpp */
170
171#endif /* !VBOX_ONLY_DOCS */
172unsigned long VBoxSVNRev();
173
174#endif /* !___H_VBOXMANAGE */
175
Note: See TracBrowser for help on using the repository browser.

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