- Timestamp:
- Jun 3, 2008 5:10:09 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r8690 r9360 1 /* $Id$ */ 2 1 3 /** @file 2 4 * … … 5 7 6 8 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.9 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 8 10 * 9 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 23 22 24 #include "GuestImpl.h" 25 26 #include "Global.h" 23 27 #include "ConsoleImpl.h" 24 28 #include "VMMDev.h" … … 334 338 mData.mAdditionsVersion = aVersion; 335 339 mData.mAdditionsActive = !aVersion.isNull(); 336 /** @todo Translate aOsType to a string and assign it to mData.mOSTypeId. 337 * The problem is just that the VBOXOSTYPE -> string translation table is in VBoxSVC. :/ 338 * We need this fixed for correct session information! */ 340 341 mData.mOSTypeId = Global::OSTypeId (aOsType); 339 342 } 340 343 -
trunk/src/VBox/Main/Makefile.kmk
r8903 r9360 182 182 183 183 VBoxSVC_SOURCES = \ 184 Global.cpp \ 184 185 Logging.cpp \ 185 186 AutoLock.cpp \ … … 362 363 363 364 VBoxC_SOURCES = \ 365 Global.cpp \ 364 366 Logging.cpp \ 365 367 AutoLock.cpp \ … … 528 530 VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H) 529 531 VBoxC_INCS += $(PATH_TARGET) 532 VBoxC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP) 530 533 531 534 VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H) -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r8898 r9360 1 1 /* $Id$ */ 2 2 3 /** @file 3 4 * Implmentation of IVirtualBox in VBoxSVC. … … 21 22 22 23 #include "VirtualBoxImpl.h" 24 25 #include "Global.h" 23 26 #include "MachineImpl.h" 24 27 #include "HardDiskImpl.h" … … 57 60 #include <VBox/VBoxHDD.h> 58 61 #include <VBox/VBoxHDD-new.h> 59 #include <VBox/ostypes.h>60 62 #include <VBox/version.h> 61 63 … … 77 79 ///////////////////////////////////////////////////////////////////////////// 78 80 79 static const char DefaultGlobalConfig [] =81 static const char gDefaultGlobalConfig [] = 80 82 { 81 83 "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" RTFILE_LINEFEED … … 188 190 if (VBOX_SUCCESS (vrc)) 189 191 vrc = RTFileWrite (handle, 190 (void *) DefaultGlobalConfig,191 sizeof ( DefaultGlobalConfig), NULL);192 (void *) gDefaultGlobalConfig, 193 sizeof (gDefaultGlobalConfig), NULL); 192 194 if (VBOX_FAILURE (vrc)) 193 195 { … … 237 239 238 240 /* guest OS type objects, needed by machines */ 239 rc = registerGuestOSTypes(); 240 ComAssertComRCThrowRC (rc); 241 for (size_t i = 0; i < RT_ELEMENTS (Global::sOSTypes); ++ i) 242 { 243 ComObjPtr <GuestOSType> guestOSTypeObj; 244 rc = guestOSTypeObj.createObject(); 245 if (SUCCEEDED (rc)) 246 { 247 rc = guestOSTypeObj->init (Global::sOSTypes [i].id, 248 Global::sOSTypes [i].description, 249 Global::sOSTypes [i].osType, 250 Global::sOSTypes [i].recommendedRAM, 251 Global::sOSTypes [i].recommendedVRAM, 252 Global::sOSTypes [i].recommendedHDD); 253 if (SUCCEEDED (rc)) 254 mData.mGuestOSTypes.push_back (guestOSTypeObj); 255 } 256 ComAssertComRCThrowRC (rc); 257 } 241 258 242 259 /* hard disks, needed by machines */ … … 4458 4475 if (!aOnStartUp) 4459 4476 rc = saveSettings(); 4460 4461 return rc;4462 }4463 4464 /**4465 * Helper function to create the guest OS type objects and our collection4466 *4467 * @returns COM status code4468 */4469 HRESULT VirtualBox::registerGuestOSTypes()4470 {4471 AutoCaller autoCaller (this);4472 AssertComRCReturn (autoCaller.rc(), E_FAIL);4473 AssertReturn (autoCaller.state() == InInit, E_FAIL);4474 4475 HRESULT rc = S_OK;4476 4477 // this table represents our os type / string mapping4478 static struct4479 {4480 const char *id; // utf-84481 const char *description; // utf-84482 const VBOXOSTYPE osType;4483 const uint32_t recommendedRAM;4484 const uint32_t recommendedVRAM;4485 const uint32_t recommendedHDD;4486 } OSTypes [SchemaDefs::OSTypeId_COUNT] =4487 {4488 /// @todo (dmik) get the list of OS types from the XML schema4489 /* NOTE1: we assume that unknown is always the first entry!4490 * NOTE2: please use powers of 2 when specifying the size of harddisks since4491 * '2GB' looks better than '1.95GB' (= 2000MB) */4492 { SchemaDefs_OSTypeId_unknown, tr ("Other/Unknown"), VBOXOSTYPE_Unknown, 64, 4, 2 * _1K },4493 { SchemaDefs_OSTypeId_dos, "DOS", VBOXOSTYPE_DOS, 32, 4, 512 },4494 { SchemaDefs_OSTypeId_win31, "Windows 3.1", VBOXOSTYPE_Win31, 32, 4, 1 * _1K },4495 { SchemaDefs_OSTypeId_win95, "Windows 95", VBOXOSTYPE_Win95, 64, 4, 2 * _1K },4496 { SchemaDefs_OSTypeId_win98, "Windows 98", VBOXOSTYPE_Win98, 64, 4, 2 * _1K },4497 { SchemaDefs_OSTypeId_winme, "Windows Me", VBOXOSTYPE_WinMe, 64, 4, 4 * _1K },4498 { SchemaDefs_OSTypeId_winnt4, "Windows NT 4", VBOXOSTYPE_WinNT4, 128, 4, 2 * _1K },4499 { SchemaDefs_OSTypeId_win2k, "Windows 2000", VBOXOSTYPE_Win2k, 168, 12, 4 * _1K },4500 { SchemaDefs_OSTypeId_winxp, "Windows XP", VBOXOSTYPE_WinXP, 192, 12, 10 * _1K },4501 { SchemaDefs_OSTypeId_win2k3, "Windows Server 2003", VBOXOSTYPE_Win2k3, 256, 12, 20 * _1K },4502 { SchemaDefs_OSTypeId_winvista, "Windows Vista", VBOXOSTYPE_WinVista, 512, 12, 20 * _1K },4503 { SchemaDefs_OSTypeId_win2k8, "Windows Server 2008", VBOXOSTYPE_Win2k8, 256, 12, 20 * _1K },4504 { SchemaDefs_OSTypeId_os2warp3, "OS/2 Warp 3", VBOXOSTYPE_OS2Warp3, 48, 4, 1 * _1K },4505 { SchemaDefs_OSTypeId_os2warp4, "OS/2 Warp 4", VBOXOSTYPE_OS2Warp4, 64, 4, 2 * _1K },4506 { SchemaDefs_OSTypeId_os2warp45, "OS/2 Warp 4.5", VBOXOSTYPE_OS2Warp45, 96, 4, 2 * _1K },4507 { SchemaDefs_OSTypeId_ecs, "eComStation", VBOXOSTYPE_ECS, 96, 4, 2 * _1K },4508 { SchemaDefs_OSTypeId_linux22, "Linux 2.2", VBOXOSTYPE_Linux22, 64, 4, 2 * _1K },4509 { SchemaDefs_OSTypeId_linux24, "Linux 2.4", VBOXOSTYPE_Linux24, 128, 4, 4 * _1K },4510 { SchemaDefs_OSTypeId_linux26, "Linux 2.6", VBOXOSTYPE_Linux26, 256, 4, 8 * _1K },4511 { SchemaDefs_OSTypeId_archlinux, "Arch Linux", VBOXOSTYPE_ArchLinux, 256, 12, 8 * _1K },4512 { SchemaDefs_OSTypeId_debian, "Debian", VBOXOSTYPE_Debian, 256, 12, 8 * _1K },4513 { SchemaDefs_OSTypeId_opensuse, "openSUSE", VBOXOSTYPE_OpenSUSE, 256, 12, 8 * _1K },4514 { SchemaDefs_OSTypeId_fedoracore, "Fedora", VBOXOSTYPE_FedoraCore, 256, 12, 8 * _1K },4515 { SchemaDefs_OSTypeId_gentoo, "Gentoo Linux", VBOXOSTYPE_Gentoo, 256, 12, 8 * _1K },4516 { SchemaDefs_OSTypeId_mandriva, "Mandriva", VBOXOSTYPE_Mandriva, 256, 12, 8 * _1K },4517 { SchemaDefs_OSTypeId_redhat, "Red Hat", VBOXOSTYPE_RedHat, 256, 12, 8 * _1K },4518 { SchemaDefs_OSTypeId_ubuntu, "Ubuntu", VBOXOSTYPE_Ubuntu, 256, 12, 8 * _1K },4519 { SchemaDefs_OSTypeId_xandros, "Xandros", VBOXOSTYPE_Xandros, 256, 12, 8 * _1K },4520 { SchemaDefs_OSTypeId_freebsd, "FreeBSD", VBOXOSTYPE_FreeBSD, 64, 4, 2 * _1K },4521 { SchemaDefs_OSTypeId_openbsd, "OpenBSD", VBOXOSTYPE_OpenBSD, 64, 4, 2 * _1K },4522 { SchemaDefs_OSTypeId_netbsd, "NetBSD", VBOXOSTYPE_NetBSD, 64, 4, 2 * _1K },4523 { SchemaDefs_OSTypeId_netware, "Netware", VBOXOSTYPE_Netware, 128, 4, 4 * _1K },4524 { SchemaDefs_OSTypeId_solaris, "Solaris", VBOXOSTYPE_Solaris, 512, 12, 16 * _1K },4525 { SchemaDefs_OSTypeId_opensolaris, "OpenSolaris", VBOXOSTYPE_OpenSolaris, 512, 12, 16 * _1K },4526 { SchemaDefs_OSTypeId_l4, "L4", VBOXOSTYPE_L4, 64, 4, 2 * _1K }4527 };4528 4529 for (uint32_t i = 0; i < ELEMENTS (OSTypes) && SUCCEEDED (rc); i++)4530 {4531 ComObjPtr <GuestOSType> guestOSTypeObj;4532 rc = guestOSTypeObj.createObject();4533 if (SUCCEEDED (rc))4534 {4535 rc = guestOSTypeObj->init (OSTypes[i].id,4536 OSTypes[i].description,4537 OSTypes[i].osType,4538 OSTypes[i].recommendedRAM,4539 OSTypes[i].recommendedVRAM,4540 OSTypes[i].recommendedHDD);4541 if (SUCCEEDED (rc))4542 mData.mGuestOSTypes.push_back (guestOSTypeObj);4543 }4544 }4545 4477 4546 4478 return rc; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r8765 r9360 76 76 public: 77 77 78 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (VirtualBox)79 80 78 typedef std::list <ComPtr <IVirtualBoxCallback> > CallbackList; 81 79 typedef std::vector <ComPtr <IVirtualBoxCallback> > CallbackVector; … … 83 81 class CallbackEvent; 84 82 friend class CallbackEvent; 83 84 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (VirtualBox) 85 85 86 86 DECLARE_CLASSFACTORY_SINGLETON(VirtualBox) … … 383 383 HRESULT registerDVDImage (DVDImage *aImage, bool aOnStartUp); 384 384 HRESULT registerFloppyImage (FloppyImage *aImage, bool aOnStartUp); 385 HRESULT registerGuestOSTypes();386 385 387 386 HRESULT lockConfig();
Note:
See TracChangeset
for help on using the changeset viewer.