VirtualBox

source: vbox/trunk/src/VBox/Main/Global.cpp@ 35135

Last change on this file since 35135 was 34904, checked in by vboxsync, 14 years ago

Main/Global: enable USB tablet for "Solaris modern" guests

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 35.2 KB
Line 
1/* $Id: Global.cpp 34904 2010-12-09 16:28:56Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM global definitions
6 *
7 * NOTE: This file is part of both VBoxC.dll and VBoxSVC.exe.
8 */
9
10/*
11 * Copyright (C) 2008-2010 Oracle Corporation
12 *
13 * This file is part of VirtualBox Open Source Edition (OSE), as
14 * available from http://www.virtualbox.org. This file is free software;
15 * you can redistribute it and/or modify it under the terms of the GNU
16 * General Public License (GPL) as published by the Free Software
17 * Foundation, in version 2 as it comes in the "COPYING" file of the
18 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
19 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20 */
21
22#include "Global.h"
23
24#include <iprt/assert.h>
25#include <iprt/string.h>
26#include <VBox/err.h>
27
28/* static */
29const Global::OSType Global::sOSTypes[SchemaDefs::OSTypeId_COUNT] =
30{
31 /* NOTE1: we assume that unknown is always the first entry!
32 * NOTE2: please use powers of 2 when specifying the size of harddisks since
33 * '2GB' looks better than '1.95GB' (= 2000MB) */
34 { "Other", "Other", SchemaDefs_OSTypeId_Other, "Other/Unknown",
35 VBOXOSTYPE_Unknown, VBOXOSHINT_NONE,
36 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
37 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
38 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows31, "Windows 3.1",
39 VBOXOSTYPE_Win31, VBOXOSHINT_NONE,
40 32, 4, 1 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
41 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_SB16 },
42 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows95, "Windows 95",
43 VBOXOSTYPE_Win95, VBOXOSHINT_NONE,
44 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
45 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
46 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows98, "Windows 98",
47 VBOXOSTYPE_Win98, VBOXOSHINT_NONE,
48 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
49 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
50 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsMe, "Windows Me",
51 VBOXOSTYPE_WinMe, VBOXOSHINT_NONE,
52 64, 4, 4 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
53 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
54 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT4, "Windows NT 4",
55 VBOXOSTYPE_WinNT4, VBOXOSHINT_NONE,
56 128, 16, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
57 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
58 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2000, "Windows 2000",
59 VBOXOSTYPE_Win2k, VBOXOSHINT_NONE,
60 168, 16, 4 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
61 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
62 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP, "Windows XP",
63 VBOXOSTYPE_WinXP, VBOXOSHINT_NONE,
64 192, 16, 10 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
65 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
66 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP_64, "Windows XP (64 bit)",
67 VBOXOSTYPE_WinXP_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
68 192, 16, 10 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
69 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
70 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003, "Windows 2003",
71 VBOXOSTYPE_Win2k3, VBOXOSHINT_NONE,
72 256, 16, 20 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
73 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
74 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003_64, "Windows 2003 (64 bit)",
75 VBOXOSTYPE_Win2k3_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
76 256, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
77 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_HDA },
78 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista, "Windows Vista",
79 VBOXOSTYPE_WinVista, VBOXOSHINT_NONE,
80 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
81 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
82 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista_64, "Windows Vista (64 bit)",
83 VBOXOSTYPE_WinVista_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
84 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
85 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
86 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008, "Windows 2008",
87 VBOXOSTYPE_Win2k8, VBOXOSHINT_NONE,
88 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
89 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
90 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008_64, "Windows 2008 (64 bit)",
91 VBOXOSTYPE_Win2k8_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
92 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
93 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
94 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows7, "Windows 7",
95 VBOXOSTYPE_Win7, VBOXOSHINT_NONE,
96 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
97 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
98 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows7_64, "Windows 7 (64 bit)",
99 VBOXOSTYPE_Win7_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
100 512, 16, 20 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
101 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_HDA },
102 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT, "Other Windows",
103 VBOXOSTYPE_WinNT, VBOXOSHINT_NONE,
104 512, 16, 20 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
105 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
106 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux22, "Linux 2.2",
107 VBOXOSTYPE_Linux22, VBOXOSHINT_RTCUTC,
108 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
109 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
110 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24, "Linux 2.4",
111 VBOXOSTYPE_Linux24, VBOXOSHINT_RTCUTC,
112 128, 4, 4 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
113 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
114 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24_64, "Linux 2.4 (64 bit)",
115 VBOXOSTYPE_Linux24_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC,
116 128, 4, 4 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
117 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
118 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26, "Linux 2.6",
119 VBOXOSTYPE_Linux26, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
120 256, 4, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
121 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
122 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26_64, "Linux 2.6 (64 bit)",
123 VBOXOSTYPE_Linux26_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
124 256, 4, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
125 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
126 { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux, "Arch Linux",
127 VBOXOSTYPE_ArchLinux, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
128 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
129 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
130 { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux_64, "Arch Linux (64 bit)",
131 VBOXOSTYPE_ArchLinux_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
132 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
133 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
134 { "Linux", "Linux", SchemaDefs_OSTypeId_Debian, "Debian",
135 VBOXOSTYPE_Debian, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
136 384, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
137 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
138 { "Linux", "Linux", SchemaDefs_OSTypeId_Debian_64, "Debian (64 bit)",
139 VBOXOSTYPE_Debian_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
140 384, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
141 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97},
142 { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE, "openSUSE",
143 VBOXOSTYPE_OpenSUSE, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
144 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
145 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
146 { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE_64, "openSUSE (64 bit)",
147 VBOXOSTYPE_OpenSUSE_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
148 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
149 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
150 { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora, "Fedora",
151 VBOXOSTYPE_FedoraCore, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
152 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
153 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
154 { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora_64, "Fedora (64 bit)",
155 VBOXOSTYPE_FedoraCore_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
156 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
157 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
158 { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo, "Gentoo",
159 VBOXOSTYPE_Gentoo, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
160 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
161 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
162 { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo_64, "Gentoo (64 bit)",
163 VBOXOSTYPE_Gentoo_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
164 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
165 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
166 { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva, "Mandriva",
167 VBOXOSTYPE_Mandriva, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
168 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
169 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
170 { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva_64, "Mandriva (64 bit)",
171 VBOXOSTYPE_Mandriva_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
172 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
173 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
174 { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat, "Red Hat",
175 VBOXOSTYPE_RedHat, VBOXOSHINT_RTCUTC | VBOXOSHINT_PAE,
176 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
177 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
178 { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat_64, "Red Hat (64 bit)",
179 VBOXOSTYPE_RedHat_x64, VBOXOSHINT_64BIT | VBOXOSHINT_PAE | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC,
180 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
181 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
182 { "Linux", "Linux", SchemaDefs_OSTypeId_Turbolinux, "Turbolinux",
183 VBOXOSTYPE_Turbolinux, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
184 384, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
185 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
186 { "Linux", "Linux", SchemaDefs_OSTypeId_Turbolinux, "Turbolinux (64 bit)",
187 VBOXOSTYPE_Turbolinux_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
188 384, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
189 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
190 { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu, "Ubuntu",
191 VBOXOSTYPE_Ubuntu, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
192 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
193 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
194 { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu_64, "Ubuntu (64 bit)",
195 VBOXOSTYPE_Ubuntu_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
196 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
197 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
198 { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros, "Xandros",
199 VBOXOSTYPE_Xandros, VBOXOSHINT_RTCUTC,
200 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
201 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
202 { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros_64, "Xandros (64 bit)",
203 VBOXOSTYPE_Xandros_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC,
204 256, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
205 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
206 { "Linux", "Linux", SchemaDefs_OSTypeId_Oracle, "Oracle",
207 VBOXOSTYPE_Oracle, VBOXOSHINT_RTCUTC | VBOXOSHINT_PAE,
208 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
209 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
210 { "Linux", "Linux", SchemaDefs_OSTypeId_Oracle_64, "Oracle (64 bit)",
211 VBOXOSTYPE_Oracle_x64, VBOXOSHINT_64BIT | VBOXOSHINT_PAE | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC,
212 512, 12, 8 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
213 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
214 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux, "Other Linux",
215 VBOXOSTYPE_Linux, VBOXOSHINT_RTCUTC | VBOXOSHINT_USBTABLET,
216 256, 12, 8 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
217 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
218 { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris, "Solaris legacy",
219 VBOXOSTYPE_Solaris, VBOXOSHINT_NONE,
220 768, 12, 16 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
221 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
222 { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris_64, "Solaris legacy (64 bit)",
223 VBOXOSTYPE_Solaris_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
224 768, 12, 16 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
225 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
226 { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris, "Solaris modern (S10U8+)",
227 VBOXOSTYPE_OpenSolaris, VBOXOSHINT_USBTABLET,
228 768, 12, 16 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_IntelAhci, StorageBus_SATA,
229 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
230 { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris_64, "Solaris modern (S10U8+) (64 bit)",
231 VBOXOSTYPE_OpenSolaris_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_USBTABLET,
232 768, 12, 16 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_IntelAhci, StorageBus_SATA,
233 StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97 },
234 { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD, "FreeBSD",
235 VBOXOSTYPE_FreeBSD, VBOXOSHINT_NONE,
236 128, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
237 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
238 { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD_64, "FreeBSD (64 bit)",
239 VBOXOSTYPE_FreeBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
240 128, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
241 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
242 { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD, "OpenBSD",
243 VBOXOSTYPE_OpenBSD, VBOXOSHINT_HWVIRTEX,
244 64, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
245 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
246 { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD_64, "OpenBSD (64 bit)",
247 VBOXOSTYPE_OpenBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
248 64, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
249 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
250 { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD, "NetBSD",
251 VBOXOSTYPE_NetBSD, VBOXOSHINT_NONE,
252 64, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
253 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
254 { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD_64, "NetBSD (64 bit)",
255 VBOXOSTYPE_NetBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
256 64, 4, 2 * _1G64, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
257 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
258 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp3, "OS/2 Warp 3",
259 VBOXOSTYPE_OS2Warp3, VBOXOSHINT_HWVIRTEX,
260 48, 4, 1 * _1G64, NetworkAdapterType_Am79C973, 1, StorageControllerType_PIIX4, StorageBus_IDE,
261 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
262 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp4, "OS/2 Warp 4",
263 VBOXOSTYPE_OS2Warp4, VBOXOSHINT_HWVIRTEX,
264 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 1, StorageControllerType_PIIX4, StorageBus_IDE,
265 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
266 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp45, "OS/2 Warp 4.5",
267 VBOXOSTYPE_OS2Warp45, VBOXOSHINT_HWVIRTEX,
268 96, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 1, StorageControllerType_PIIX4, StorageBus_IDE,
269 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
270 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2eCS, "eComStation",
271 VBOXOSTYPE_ECS, VBOXOSHINT_HWVIRTEX,
272 96, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 1, StorageControllerType_PIIX4, StorageBus_IDE,
273 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
274 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2, "Other OS/2",
275 VBOXOSTYPE_OS2, VBOXOSHINT_HWVIRTEX,
276 96, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 1, StorageControllerType_PIIX4, StorageBus_IDE,
277 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
278 { "MacOS", "Mac OS X", SchemaDefs_OSTypeId_MacOS, "Mac OS X Server",
279 VBOXOSTYPE_MacOS, VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_EFI | VBOXOSHINT_PAE | VBOXOSHINT_USBHID | VBOXOSHINT_HPET | VBOXOSHINT_USBTABLET,
280 1024, 4, 20 * _1G64, NetworkAdapterType_I82543GC, 0,
281 StorageControllerType_ICH6, StorageBus_IDE, StorageControllerType_IntelAhci, StorageBus_SATA,
282 ChipsetType_ICH9, AudioControllerType_HDA },
283 { "MacOS", "Mac OS X", SchemaDefs_OSTypeId_MacOS_64, "Mac OS X Server (64 bit)",
284 VBOXOSTYPE_MacOS_x64, VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_EFI | VBOXOSHINT_PAE | VBOXOSHINT_64BIT | VBOXOSHINT_USBHID | VBOXOSHINT_HPET | VBOXOSHINT_USBTABLET,
285 1024, 4, 20 * _1G64, NetworkAdapterType_I82543GC, 0,
286 StorageControllerType_ICH6, StorageBus_IDE, StorageControllerType_IntelAhci, StorageBus_SATA,
287 ChipsetType_ICH9, AudioControllerType_HDA },
288 { "Other", "Other", SchemaDefs_OSTypeId_DOS, "DOS",
289 VBOXOSTYPE_DOS, VBOXOSHINT_NONE,
290 32, 4, 512 * _1M, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
291 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_SB16 },
292 { "Other", "Other", SchemaDefs_OSTypeId_Netware, "Netware",
293 VBOXOSTYPE_Netware, VBOXOSHINT_HWVIRTEX,
294 512, 4, 4 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
295 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
296 { "Other", "Other", SchemaDefs_OSTypeId_L4, "L4",
297 VBOXOSTYPE_L4, VBOXOSHINT_NONE,
298 64, 4, 2 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
299 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
300 { "Other", "Other", SchemaDefs_OSTypeId_QNX, "QNX",
301 VBOXOSTYPE_QNX, VBOXOSHINT_HWVIRTEX,
302 512, 4, 4 * _1G64, NetworkAdapterType_Am79C973, 0, StorageControllerType_PIIX4, StorageBus_IDE,
303 StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97 },
304 { "Other", "Other", SchemaDefs_OSTypeId_JRockitVE, "JRockitVE",
305 VBOXOSTYPE_JRockitVE, VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_PAE,
306 1024, 4, 8 * _1G64, NetworkAdapterType_I82545EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
307 StorageControllerType_BusLogic, StorageBus_SCSI, ChipsetType_PIIX3, AudioControllerType_AC97 },
308};
309
310/**
311 * Returns an OS Type ID for the given VBOXOSTYPE value.
312 *
313 * The returned ID will correspond to the IGuestOSType::id value of one of the
314 * objects stored in the IVirtualBox::guestOSTypes
315 * (VirtualBoxImpl::COMGETTER(GuestOSTypes)) collection.
316 */
317/* static */
318const char *Global::OSTypeId(VBOXOSTYPE aOSType)
319{
320 for (size_t i = 0; i < RT_ELEMENTS(sOSTypes); ++i)
321 {
322 if (sOSTypes[i].osType == aOSType)
323 return sOSTypes[i].id;
324 }
325
326 AssertMsgFailed(("No record for VBOXOSTYPE %d\n", aOSType));
327 return sOSTypes[0].id;
328}
329
330/*static*/ const char *
331Global::stringifyMachineState(MachineState_T aState)
332{
333 switch (aState)
334 {
335 case MachineState_Null: return "Null";
336 case MachineState_PoweredOff: return "PoweredOff";
337 case MachineState_Saved: return "Saved";
338 case MachineState_Teleported: return "Teleported";
339 case MachineState_Aborted: return "Aborted";
340 case MachineState_Running: return "Running";
341 case MachineState_Paused: return "Paused";
342 case MachineState_Stuck: return "GuruMeditation";
343 case MachineState_Teleporting: return "Teleporting";
344 case MachineState_LiveSnapshotting: return "LiveSnapshotting";
345 case MachineState_Starting: return "Starting";
346 case MachineState_Stopping: return "Stopping";
347 case MachineState_Saving: return "Saving";
348 case MachineState_Restoring: return "Restoring";
349 case MachineState_TeleportingPausedVM: return "TeleportingPausedVM";
350 case MachineState_TeleportingIn: return "TeleportingIn";
351 case MachineState_FaultTolerantSyncing: return "FaultTolerantSyncing";
352 case MachineState_DeletingSnapshotOnline: return "DeletingSnapshotOnline";
353 case MachineState_DeletingSnapshotPaused: return "DeletingSnapshotPaused";
354 case MachineState_RestoringSnapshot: return "RestoringSnapshot";
355 case MachineState_DeletingSnapshot: return "DeletingSnapshot";
356 case MachineState_SettingUp: return "SettingUp";
357 default:
358 {
359 AssertMsgFailed(("%d (%#x)\n", aState, aState));
360 static char s_szMsg[48];
361 RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidState-0x%08x\n", aState);
362 return s_szMsg;
363 }
364 }
365}
366
367/*static*/ const char *
368Global::stringifySessionState(SessionState_T aState)
369{
370 switch (aState)
371 {
372 case SessionState_Null: return "Null";
373 case SessionState_Unlocked: return "Unlocked";
374 case SessionState_Locked: return "Locked";
375 case SessionState_Spawning: return "Spawning";
376 case SessionState_Unlocking: return "Unlocking";
377 default:
378 {
379 AssertMsgFailed(("%d (%#x)\n", aState, aState));
380 static char s_szMsg[48];
381 RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidState-0x%08x\n", aState);
382 return s_szMsg;
383 }
384 }
385}
386
387/*static*/ const char *
388Global::stringifyDeviceType(DeviceType_T aType)
389{
390 switch (aType)
391 {
392 case DeviceType_Null: return "Null";
393 case DeviceType_Floppy: return "Floppy";
394 case DeviceType_DVD: return "DVD";
395 case DeviceType_HardDisk: return "HardDisk";
396 case DeviceType_Network: return "Network";
397 case DeviceType_USB: return "USB";
398 case DeviceType_SharedFolder: return "ShardFolder";
399 default:
400 {
401 AssertMsgFailed(("%d (%#x)\n", aType, aType));
402 static char s_szMsg[48];
403 RTStrPrintf(s_szMsg, sizeof(s_szMsg), "InvalidType-0x%08x\n", aType);
404 return s_szMsg;
405 }
406 }
407}
408
409/*static*/ int
410Global::vboxStatusCodeFromCOM(HRESULT aComStatus)
411{
412 switch (aComStatus)
413 {
414 case S_OK: return VINF_SUCCESS;
415
416 /* Standard COM status codes. See also RTErrConvertFromDarwinCOM */
417 case E_UNEXPECTED: return VERR_COM_UNEXPECTED;
418 case E_NOTIMPL: return VERR_NOT_IMPLEMENTED;
419 case E_OUTOFMEMORY: return VERR_NO_MEMORY;
420 case E_INVALIDARG: return VERR_INVALID_PARAMETER;
421 case E_NOINTERFACE: return VERR_NOT_SUPPORTED;
422 case E_POINTER: return VERR_INVALID_POINTER;
423#ifdef E_HANDLE
424 case E_HANDLE: return VERR_INVALID_HANDLE;
425#endif
426 case E_ABORT: return VERR_CANCELLED;
427 case E_FAIL: return VERR_GENERAL_FAILURE;
428 case E_ACCESSDENIED: return VERR_ACCESS_DENIED;
429
430 /* VirtualBox status codes */
431 case VBOX_E_OBJECT_NOT_FOUND: return VERR_COM_OBJECT_NOT_FOUND;
432 case VBOX_E_INVALID_VM_STATE: return VERR_COM_INVALID_VM_STATE;
433 case VBOX_E_VM_ERROR: return VERR_COM_VM_ERROR;
434 case VBOX_E_FILE_ERROR: return VERR_COM_FILE_ERROR;
435 case VBOX_E_IPRT_ERROR: return VERR_COM_IPRT_ERROR;
436 case VBOX_E_PDM_ERROR: return VERR_COM_PDM_ERROR;
437 case VBOX_E_INVALID_OBJECT_STATE: return VERR_COM_INVALID_OBJECT_STATE;
438 case VBOX_E_HOST_ERROR: return VERR_COM_HOST_ERROR;
439 case VBOX_E_NOT_SUPPORTED: return VERR_COM_NOT_SUPPORTED;
440 case VBOX_E_XML_ERROR: return VERR_COM_XML_ERROR;
441 case VBOX_E_INVALID_SESSION_STATE: return VERR_COM_INVALID_SESSION_STATE;
442 case VBOX_E_OBJECT_IN_USE: return VERR_COM_OBJECT_IN_USE;
443
444 default:
445 if (SUCCEEDED(aComStatus))
446 return VINF_SUCCESS;
447 /** @todo Check for the win32 facility and use the
448 * RTErrConvertFromWin32 function on windows. */
449 return VERR_UNRESOLVED_ERROR;
450 }
451}
452
453
454/*static*/ HRESULT
455Global::vboxStatusCodeToCOM(int aVBoxStatus)
456{
457 switch (aVBoxStatus)
458 {
459 case VINF_SUCCESS: return S_OK;
460
461 /* Standard COM status codes. */
462 case VERR_COM_UNEXPECTED: return E_UNEXPECTED;
463 case VERR_NOT_IMPLEMENTED: return E_NOTIMPL;
464 case VERR_NO_MEMORY: return E_OUTOFMEMORY;
465 case VERR_INVALID_PARAMETER: return E_INVALIDARG;
466 case VERR_NOT_SUPPORTED: return E_NOINTERFACE;
467 case VERR_INVALID_POINTER: return E_POINTER;
468#ifdef E_HANDLE
469 case VERR_INVALID_HANDLE: return E_HANDLE;
470#endif
471 case VERR_CANCELLED: return E_ABORT;
472 case VERR_GENERAL_FAILURE: return E_FAIL;
473 case VERR_ACCESS_DENIED: return E_ACCESSDENIED;
474
475 /* VirtualBox COM status codes */
476 case VERR_COM_OBJECT_NOT_FOUND: return VBOX_E_OBJECT_NOT_FOUND;
477 case VERR_COM_INVALID_VM_STATE: return VBOX_E_INVALID_VM_STATE;
478 case VERR_COM_VM_ERROR: return VBOX_E_VM_ERROR;
479 case VERR_COM_FILE_ERROR: return VBOX_E_FILE_ERROR;
480 case VERR_COM_IPRT_ERROR: return VBOX_E_IPRT_ERROR;
481 case VERR_COM_PDM_ERROR: return VBOX_E_PDM_ERROR;
482 case VERR_COM_INVALID_OBJECT_STATE: return VBOX_E_INVALID_OBJECT_STATE;
483 case VERR_COM_HOST_ERROR: return VBOX_E_HOST_ERROR;
484 case VERR_COM_NOT_SUPPORTED: return VBOX_E_NOT_SUPPORTED;
485 case VERR_COM_XML_ERROR: return VBOX_E_XML_ERROR;
486 case VERR_COM_INVALID_SESSION_STATE: return VBOX_E_INVALID_SESSION_STATE;
487 case VERR_COM_OBJECT_IN_USE: return VBOX_E_OBJECT_IN_USE;
488
489 /* Other errors. */
490 case VERR_UNRESOLVED_ERROR: return E_FAIL;
491
492 default:
493 AssertMsgFailed(("%Rrc\n", aVBoxStatus));
494 if (RT_SUCCESS(aVBoxStatus))
495 return S_OK;
496
497 /* try categorize it */
498 if ( aVBoxStatus < 0
499 && ( aVBoxStatus > -1000
500 || (aVBoxStatus < -22000 && aVBoxStatus > -32766) )
501 )
502 return VBOX_E_IPRT_ERROR;
503 if ( aVBoxStatus < VERR_PDM_NO_SUCH_LUN / 100 * 10
504 && aVBoxStatus > VERR_PDM_NO_SUCH_LUN / 100 * 10 - 100)
505 return VBOX_E_PDM_ERROR;
506 if ( aVBoxStatus <= -1000
507 && aVBoxStatus > -5000 /* wrong, but so what... */)
508 return VBOX_E_VM_ERROR;
509
510 return E_FAIL;
511 }
512}
513
514
515/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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