儲存庫 vbox 的更動 14664
- 時間撮記:
- 2008-11-26 下午09:19:35 (16 年 以前)
- svn:sync-xref-src-repo-rev:
- 39973
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 17 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r14646 r14664 318 318 { 319 319 RTPrintf("VBoxManage createvm -name <name>\n" 320 " [-ostype <ostype>]\n" 320 321 " [-register]\n" 321 322 " [-basefolder <path> | -settingsfile <path>]\n" … … 1345 1346 Bstr settingsFile; 1346 1347 Bstr name; 1348 Bstr osTypeId; 1347 1349 RTUUID id; 1348 1350 bool fRegister = false; … … 1372 1374 name = argv[i]; 1373 1375 } 1376 else if (strcmp(argv[i], "-ostype") == 0) 1377 { 1378 if (argc <= i + 1) 1379 return errorArgument("Missing argument to '%s'", argv[i]); 1380 i++; 1381 osTypeId = argv[i]; 1382 } 1374 1383 else if (strcmp(argv[i], "-uuid") == 0) 1375 1384 { … … 1399 1408 if (!settingsFile) 1400 1409 CHECK_ERROR_BREAK(virtualBox, 1401 CreateMachine( baseFolder, name, Guid(id), machine.asOutParam()));1410 CreateMachine(name, osTypeId, baseFolder, Guid(id), machine.asOutParam())); 1402 1411 else 1403 1412 CHECK_ERROR_BREAK(virtualBox, 1404 CreateLegacyMachine( settingsFile, name, Guid(id), machine.asOutParam()));1413 CreateLegacyMachine(name, osTypeId, settingsFile, Guid(id), machine.asOutParam())); 1405 1414 1406 1415 CHECK_ERROR_BREAK(machine, SaveSettings()); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h
r13580 r14664 291 291 CVirtualBox vbox = vboxGlobal().virtualBox(); 292 292 293 /* OS type */ 294 CGuestOSType type = vboxGlobal().vmGuestOSType (cbOS->currentItem()); 295 AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type")); 296 QString typeId = type.GetId(); 297 293 298 /* create a machine with the default settings file location */ 294 299 if (mMachine.isNull()) 295 300 { 296 mMachine = vbox.CreateMachine ( QString(), leName->text(), QUuid());301 mMachine = vbox.CreateMachine (leName->text(), typeId, QString::null, QUuid()); 297 302 if (!vbox.isOk()) 298 303 { … … 308 313 } 309 314 310 /* name is set in CreateMachine() */311 312 /* OS type */313 CGuestOSType type = vboxGlobal().vmGuestOSType (cbOS->currentItem());314 AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));315 QString typeId = type.GetId();316 mMachine.SetOSTypeId (typeId);317 318 if (typeId == "os2warp3" ||319 typeId == "os2warp4" ||320 typeId == "os2warp45" ||321 typeId == "ecs")322 mMachine.SetHWVirtExEnabled (KTSBool_True);323 324 315 /* RAM size */ 325 316 mMachine.SetMemorySize (slRAM->value()); 326 327 /* add one network adapter (NAT) by default */328 {329 CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);330 #ifdef VBOX_WITH_E1000331 /* Default to e1k on solaris */332 if (typeId == "solaris" ||333 typeId == "opensolaris")334 cadapter.SetAdapterType (KNetworkAdapterType_I82540EM);335 #endif /* VBOX_WITH_E1000 */336 cadapter.SetEnabled (true);337 cadapter.AttachToNAT();338 cadapter.SetMACAddress (QString::null);339 cadapter.SetCableConnected (true);340 341 }342 317 343 318 /* register the VM prior to attaching hard disks */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r14652 r14664 5262 5262 { 5263 5263 CGuestOSTypeEnumerator en = coll.Enumerate(); 5264 5265 /* Here we assume 'Other' type is always the first, so we 5266 * remember it and will append it to the list when finish */ 5267 CGuestOSType otherType (en.GetNext()); 5268 QString otherFamilyId (otherType.GetFamilyId()); 5269 5270 /* Fill the lists with all the available OS Types except 5271 * the 'Other' one type, it will be appended. */ 5264 5272 while (en.HasMore()) 5265 5273 { … … 5273 5281 mTypes [mFamilyIDs.indexOf (familyId)].append (os); 5274 5282 } 5283 5284 /* Append the 'Other' OS Type to the end of list */ 5285 if (!mFamilyIDs.contains (otherFamilyId)) 5286 { 5287 mFamilyIDs << otherFamilyId; 5288 mTypes << QList <CGuestOSType> (); 5289 } 5290 mTypes [mFamilyIDs.indexOf (otherFamilyId)].append (otherType); 5275 5291 } 5276 5292 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp
r14442 r14664 303 303 CVirtualBox vbox = vboxGlobal().virtualBox(); 304 304 305 /* OS type */ 306 CGuestOSType type = mOSTypeSelector->type(); 307 AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type")); 308 QString typeId = type.GetId(); 309 305 310 /* Create a machine with the default settings file location */ 306 311 if (mMachine.isNull()) 307 312 { 308 mMachine = vbox.CreateMachine ( QString(), mLeName->text(), QUuid());313 mMachine = vbox.CreateMachine (mLeName->text(), typeId, QString::null, QUuid()); 309 314 if (!vbox.isOk()) 310 315 { … … 320 325 } 321 326 322 /* OS type */323 CGuestOSType type = mOSTypeSelector->type();324 AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));325 QString typeId = type.GetId();326 mMachine.SetOSTypeId (typeId);327 328 /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */329 if (typeId == "os2warp3" ||330 typeId == "os2warp4" ||331 typeId == "os2warp45" ||332 typeId == "ecs")333 mMachine.SetHWVirtExEnabled (KTSBool_True);334 /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */335 336 327 /* RAM size */ 337 328 mMachine.SetMemorySize (mSlRAM->value()); … … 340 331 mMachine.SetVRAMSize (qMax (type.GetRecommendedVRAM(), 341 332 (ULONG) (VBoxGlobal::requiredVideoMemory() / _1M))); 342 343 /* Add one network adapter (NAT) by default */344 {345 CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);346 #ifdef VBOX_WITH_E1000347 /* Default to e1k on solaris */348 if (typeId == "solaris" ||349 typeId == "opensolaris")350 cadapter.SetAdapterType (KNetworkAdapterType_I82540EM);351 #endif /* VBOX_WITH_E1000 */352 cadapter.SetEnabled (true);353 cadapter.AttachToNAT();354 cadapter.SetMACAddress (QString::null);355 cadapter.SetCableConnected (true);356 }357 333 358 334 /* Register the VM prior to attaching hard disks */ -
trunk/src/VBox/Main/BIOSSettingsImpl.cpp
r14579 r14664 23 23 #include "MachineImpl.h" 24 24 #include "Logging.h" 25 #include "GuestOSTypeImpl.h" 25 26 #include <iprt/cpputils.h> 26 27 … … 730 731 } 731 732 733 void BIOSSettings::applyDefaults (GuestOSType *aOsType) 734 { 735 if (!aOsType) 736 return; 737 738 /* Initialize default BIOS settings here */ 739 mData->mIOAPICEnabled = aOsType->recommendedIOAPIC(); 740 } 741 -
trunk/src/VBox/Main/Global.cpp
r14520 r14664 34 34 * NOTE2: please use powers of 2 when specifying the size of harddisks since 35 35 * '2GB' looks better than '1.95GB' (= 2000MB) */ 36 { "Other", "Other", SchemaDefs_OSTypeId_Other, "Other/Unknown", 37 VBOXOSTYPE_Unknown, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 36 38 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows31, "Windows 3.1", 37 VBOXOSTYPE_Win31, false, 32, 4, 1 * _1K},39 VBOXOSTYPE_Win31, false, false, false, 32, 4, 1 * _1K, NetworkAdapterType_Am79C973 }, 38 40 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows95, "Windows 95", 39 VBOXOSTYPE_Win95, false, 64, 4, 2 * _1K},41 VBOXOSTYPE_Win95, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 40 42 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows98, "Windows 98", 41 VBOXOSTYPE_Win98, false, 64, 4, 2 * _1K},43 VBOXOSTYPE_Win98, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 42 44 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsMe, "Windows Me", 43 VBOXOSTYPE_WinMe, false, 64, 4, 4 * _1K},45 VBOXOSTYPE_WinMe, false, false, false, 64, 4, 4 * _1K, NetworkAdapterType_Am79C973 }, 44 46 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT4, "Windows NT 4", 45 VBOXOSTYPE_WinNT4, false, 128, 4, 2 * _1K},47 VBOXOSTYPE_WinNT4, false, false, false, 128, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 46 48 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2000, "Windows 2000", 47 VBOXOSTYPE_Win2k, false, 168, 12, 4 * _1K},49 VBOXOSTYPE_Win2k, false, false, false, 168, 12, 4 * _1K, NetworkAdapterType_Am79C973 }, 48 50 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP, "Windows XP", 49 VBOXOSTYPE_WinXP, false, 192, 12, 10 * _1K},51 VBOXOSTYPE_WinXP, false, false, false, 192, 12, 10 * _1K, NetworkAdapterType_Am79C973 }, 50 52 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP_64, "Windows XP (64 bit)", 51 VBOXOSTYPE_WinXP_x64, true, 192, 12, 10 * _1K},53 VBOXOSTYPE_WinXP_x64, true, true, true, 192, 12, 10 * _1K, NetworkAdapterType_I82540EM }, 52 54 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003, "Windows 2003", 53 VBOXOSTYPE_Win2k3, false, 256, 12, 20 * _1K},55 VBOXOSTYPE_Win2k3, false, false, false, 256, 12, 20 * _1K, NetworkAdapterType_Am79C973 }, 54 56 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003_64, "Windows 2003 (64 bit)", 55 VBOXOSTYPE_Win2k3_x64, true, 256, 12, 20 * _1K},57 VBOXOSTYPE_Win2k3_x64, true, true, true, 256, 12, 20 * _1K, NetworkAdapterType_I82540EM }, 56 58 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista, "Windows Vista", 57 VBOXOSTYPE_WinVista, false, 512, 12, 20 * _1K},59 VBOXOSTYPE_WinVista, false, false, false, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 }, 58 60 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista_64, "Windows Vista (64 bit)", 59 VBOXOSTYPE_WinVista_x64, true, 512, 12, 20 * _1K},61 VBOXOSTYPE_WinVista_x64, true, true, true, 512, 12, 20 * _1K, NetworkAdapterType_I82540EM }, 60 62 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008, "Windows 2008", 61 VBOXOSTYPE_Win2k8, false, 512, 12, 20 * _1K},63 VBOXOSTYPE_Win2k8, false, false, false, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 }, 62 64 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008_64, "Windows 2008 (64 bit)", 63 VBOXOSTYPE_Win2k8_x64, true, 512, 12, 20 * _1K},65 VBOXOSTYPE_Win2k8_x64, true, true, true, 512, 12, 20 * _1K, NetworkAdapterType_I82540EM }, 64 66 { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT, "Other Windows", 65 VBOXOSTYPE_WinNT, false, 512, 12, 20 * _1K},67 VBOXOSTYPE_WinNT, false, false, false, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 }, 66 68 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux22, "Linux 2.2", 67 VBOXOSTYPE_Linux22, false, 64, 4, 2 * _1K},69 VBOXOSTYPE_Linux22, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 68 70 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24, "Linux 2.4", 69 VBOXOSTYPE_Linux24, false, 128, 4, 4 * _1K},71 VBOXOSTYPE_Linux24, false, false, false, 128, 4, 4 * _1K, NetworkAdapterType_Am79C973 }, 70 72 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24_64, "Linux 2.4 (64 bit)", 71 VBOXOSTYPE_Linux24_x64, true, 128, 4, 4 * _1K},73 VBOXOSTYPE_Linux24_x64, true, true, true, 128, 4, 4 * _1K, NetworkAdapterType_I82540EM }, 72 74 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26, "Linux 2.6", 73 VBOXOSTYPE_Linux26, false, 256, 4, 8 * _1K},75 VBOXOSTYPE_Linux26, false, false, false, 256, 4, 8 * _1K, NetworkAdapterType_Am79C973 }, 74 76 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26_64, "Linux 2.6 (64 bit)", 75 VBOXOSTYPE_Linux26_x64, true, 256, 4, 8 * _1K},77 VBOXOSTYPE_Linux26_x64, true, true, true, 256, 4, 8 * _1K, NetworkAdapterType_I82540EM }, 76 78 { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux, "Arch Linux", 77 VBOXOSTYPE_ArchLinux, false, 256, 12, 8 * _1K},79 VBOXOSTYPE_ArchLinux, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 78 80 { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux_64, "Arch Linux (64 bit)", 79 VBOXOSTYPE_ArchLinux_x64, true, 256, 12, 8 * _1K},81 VBOXOSTYPE_ArchLinux_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 80 82 { "Linux", "Linux", SchemaDefs_OSTypeId_Debian, "Debian", 81 VBOXOSTYPE_Debian, false, 256, 12, 8 * _1K},83 VBOXOSTYPE_Debian, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 82 84 { "Linux", "Linux", SchemaDefs_OSTypeId_Debian_64, "Debian (64 bit)", 83 VBOXOSTYPE_Debian_x64, true, 256, 12, 8 * _1K},85 VBOXOSTYPE_Debian_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 84 86 { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE, "openSUSE", 85 VBOXOSTYPE_OpenSUSE, false, 256, 12, 8 * _1K},87 VBOXOSTYPE_OpenSUSE, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 86 88 { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE_64, "openSUSE (64 bit)", 87 VBOXOSTYPE_OpenSUSE_x64, true, 256, 12, 8 * _1K},89 VBOXOSTYPE_OpenSUSE_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 88 90 { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora, "Fedora", 89 VBOXOSTYPE_FedoraCore, false, 256, 12, 8 * _1K},91 VBOXOSTYPE_FedoraCore, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 90 92 { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora_64, "Fedora (64 bit)", 91 VBOXOSTYPE_FedoraCore_x64, true, 256, 12, 8 * _1K},93 VBOXOSTYPE_FedoraCore_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 92 94 { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo, "Gentoo", 93 VBOXOSTYPE_Gentoo, false, 256, 12, 8 * _1K},95 VBOXOSTYPE_Gentoo, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 94 96 { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo_64, "Gentoo (64 bit)", 95 VBOXOSTYPE_Gentoo_x64, true, 256, 12, 8 * _1K},97 VBOXOSTYPE_Gentoo_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 96 98 { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva, "Mandriva", 97 VBOXOSTYPE_Mandriva, false, 256, 12, 8 * _1K},99 VBOXOSTYPE_Mandriva, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 98 100 { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva_64, "Mandriva (64 bit)", 99 VBOXOSTYPE_Mandriva_x64, true, 256, 12, 8 * _1K},101 VBOXOSTYPE_Mandriva_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 100 102 { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat, "Red Hat", 101 VBOXOSTYPE_RedHat, false, 256, 12, 8 * _1K},103 VBOXOSTYPE_RedHat, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 102 104 { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat_64, "Red Hat (64 bit)", 103 VBOXOSTYPE_RedHat_x64, true, 256, 12, 8 * _1K},105 VBOXOSTYPE_RedHat_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 104 106 { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu, "Ubuntu", 105 VBOXOSTYPE_Ubuntu, false, 256, 12, 8 * _1K},107 VBOXOSTYPE_Ubuntu, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 106 108 { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu_64, "Ubuntu (64 bit)", 107 VBOXOSTYPE_Ubuntu_x64, true, 256, 12, 8 * _1K},109 VBOXOSTYPE_Ubuntu_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 108 110 { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros, "Xandros", 109 VBOXOSTYPE_Xandros, false, 256, 12, 8 * _1K},111 VBOXOSTYPE_Xandros, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 110 112 { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros_64, "Xandros (64 bit)", 111 VBOXOSTYPE_Xandros_x64, true, 256, 12, 8 * _1K},113 VBOXOSTYPE_Xandros_x64, true, true, true, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM }, 112 114 { "Linux", "Linux", SchemaDefs_OSTypeId_Linux, "Other Linux", 113 VBOXOSTYPE_Linux, false, 256, 12, 8 * _1K},115 VBOXOSTYPE_Linux, false, false, false, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 }, 114 116 { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris, "Solaris", 115 VBOXOSTYPE_Solaris, false, 512, 12, 16 * _1K},117 VBOXOSTYPE_Solaris, false, false, false, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM }, 116 118 { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris_64, "Solaris (64 bit)", 117 VBOXOSTYPE_Solaris_x64, true, 512, 12, 16 * _1K},119 VBOXOSTYPE_Solaris_x64, true, true, true, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM }, 118 120 { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris, "OpenSolaris", 119 VBOXOSTYPE_OpenSolaris, false, 512, 12, 16 * _1K},121 VBOXOSTYPE_OpenSolaris, false, false, false, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM }, 120 122 { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris_64, "OpenSolaris (64 bit)", 121 VBOXOSTYPE_OpenSolaris_x64, true, 512, 12, 16 * _1K},123 VBOXOSTYPE_OpenSolaris_x64, true, true, true, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM }, 122 124 { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD, "FreeBSD", 123 VBOXOSTYPE_FreeBSD, false, 64, 4, 2 * _1K},125 VBOXOSTYPE_FreeBSD, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 124 126 { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD_64, "FreeBSD (64 bit)", 125 VBOXOSTYPE_FreeBSD_x64, true, 64, 4, 2 * _1K},127 VBOXOSTYPE_FreeBSD_x64, true, true, true, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM }, 126 128 { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD, "OpenBSD", 127 VBOXOSTYPE_OpenBSD, false, 64, 4, 2 * _1K},129 VBOXOSTYPE_OpenBSD, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 128 130 { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD_64, "OpenBSD (64 bit)", 129 VBOXOSTYPE_OpenBSD_x64, true, 64, 4, 2 * _1K},131 VBOXOSTYPE_OpenBSD_x64, true, true, true, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM }, 130 132 { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD, "NetBSD", 131 VBOXOSTYPE_NetBSD, false, 64, 4, 2 * _1K},133 VBOXOSTYPE_NetBSD, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 132 134 { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD_64, "NetBSD (64 bit)", 133 VBOXOSTYPE_NetBSD_x64, true, 64, 4, 2 * _1K},135 VBOXOSTYPE_NetBSD_x64, true, true, true, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM }, 134 136 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp3, "OS/2 Warp 3", 135 VBOXOSTYPE_OS2Warp3, false, 48, 4, 1 * _1K},137 VBOXOSTYPE_OS2Warp3, false, false, true, 48, 4, 1 * _1K, NetworkAdapterType_Am79C973 }, 136 138 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp4, "OS/2 Warp 4", 137 VBOXOSTYPE_OS2Warp4, false, 64, 4, 2 * _1K},139 VBOXOSTYPE_OS2Warp4, false, false, true, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 138 140 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp45, "OS/2 Warp 4.5", 139 VBOXOSTYPE_OS2Warp45, false, 96, 4, 2 * _1K},141 VBOXOSTYPE_OS2Warp45, false, false, true, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 140 142 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2eCS, "eComStation", 141 VBOXOSTYPE_ECS, false, 96, 4, 2 * _1K},143 VBOXOSTYPE_ECS, false, false, true, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 142 144 { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2, "Other OS/2", 143 VBOXOSTYPE_OS2, false, 96, 4, 2 * _1K},145 VBOXOSTYPE_OS2, false, false, true, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 }, 144 146 { "Other", "Other", SchemaDefs_OSTypeId_DOS, "DOS", 145 VBOXOSTYPE_DOS, false, 32, 4, 512},147 VBOXOSTYPE_DOS, false, false, false, 32, 4, 512, NetworkAdapterType_Am79C973 }, 146 148 { "Other", "Other", SchemaDefs_OSTypeId_Netware, "Netware", 147 VBOXOSTYPE_Netware, false, 512, 4, 4 * _1K},149 VBOXOSTYPE_Netware, false, false, false, 512, 4, 4 * _1K, NetworkAdapterType_Am79C973 }, 148 150 { "Other", "Other", SchemaDefs_OSTypeId_L4, "L4", 149 VBOXOSTYPE_L4, false, 64, 4, 2 * _1K }, 150 { "Other", "Other", SchemaDefs_OSTypeId_Other, "Other/Unknown", 151 VBOXOSTYPE_Unknown, false, 64, 4, 2 * _1K } 151 VBOXOSTYPE_L4, false, false, false, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 } 152 152 }; 153 153 -
trunk/src/VBox/Main/GuestOSTypeImpl.cpp
r14579 r14664 30 30 : mOSType (VBOXOSTYPE_Unknown) 31 31 , mIs64Bit (false) 32 , mRecommendedIOAPIC (false) 33 , mRecommendedVirtEx (false) 32 34 , mRAMSize (0), mVRAMSize (0) 33 35 , mHDDSize (0), mMonitorCount (0) 36 , mNetworkAdapterType (NetworkAdapterType_Am79C973) 34 37 { 35 38 } … … 69 72 const char *aId, const char *aDescription, 70 73 VBOXOSTYPE aOSType, bool aIs64Bit, 71 uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize) 74 bool aRecommendedIOAPIC, bool aRecommendedVirtEx, 75 uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize, 76 NetworkAdapterType_T aNetworkAdapterType) 72 77 { 73 78 LogFlowThisFunc (("aFamilyId='%s', aFamilyDescription='%s', " 74 79 "aId='%s', aDescription='%s', " 75 80 "aType=%d, aIs64Bit=%d, " 76 "aRAMSize=%d, aVRAMSize=%d, aHDDSize=%d\n", 81 "aRecommendedIOAPIC=%d, aRecommendedVirtEx=%d, " 82 "aRAMSize=%d, aVRAMSize=%d, aHDDSize=%d, " 83 "aNetworkAdapterType=%d\n", 77 84 aFamilyId, aFamilyDescription, 78 85 aId, aDescription, 79 86 aOSType, aIs64Bit, 80 aRAMSize, aVRAMSize, aHDDSize)); 87 aRecommendedIOAPIC, aRecommendedVirtEx, 88 aRAMSize, aVRAMSize, aHDDSize, 89 aNetworkAdapterType)); 81 90 82 91 ComAssertRet (aFamilyId && aFamilyDescription && aId && aDescription, E_INVALIDARG); … … 92 101 unconst (mOSType) = aOSType; 93 102 unconst (mIs64Bit) = aIs64Bit; 103 unconst (mRecommendedIOAPIC) = aRecommendedIOAPIC; 104 unconst (mRecommendedVirtEx) = aRecommendedVirtEx; 94 105 unconst (mRAMSize) = aRAMSize; 95 106 unconst (mVRAMSize) = aVRAMSize; 96 107 unconst (mHDDSize) = aHDDSize; 108 unconst (mNetworkAdapterType) = aNetworkAdapterType; 97 109 98 110 /* Confirm a successful initialization when it's the case */ … … 187 199 } 188 200 201 STDMETHODIMP GuestOSType::COMGETTER(RecommendedIOAPIC) (BOOL *aRecommendedIOAPIC) 202 { 203 if (!aRecommendedIOAPIC) 204 return E_POINTER; 205 206 AutoCaller autoCaller (this); 207 CheckComRCReturnRC (autoCaller.rc()); 208 209 /* mRecommendedIOAPIC is constant during life time, no need to lock */ 210 *aRecommendedIOAPIC = mRecommendedIOAPIC; 211 212 return S_OK; 213 } 214 215 STDMETHODIMP GuestOSType::COMGETTER(RecommendedVirtEx) (BOOL *aRecommendedVirtEx) 216 { 217 if (!aRecommendedVirtEx) 218 return E_POINTER; 219 220 AutoCaller autoCaller (this); 221 CheckComRCReturnRC (autoCaller.rc()); 222 223 /* mRecommendedVirtEx is constant during life time, no need to lock */ 224 *aRecommendedVirtEx = mRecommendedVirtEx; 225 226 return S_OK; 227 } 228 189 229 STDMETHODIMP GuestOSType::COMGETTER(RecommendedRAM) (ULONG *aRAMSize) 190 230 { … … 228 268 return S_OK; 229 269 } 270 271 STDMETHODIMP GuestOSType::COMGETTER(AdapterType) (NetworkAdapterType_T *aNetworkAdapterType) 272 { 273 if (!aNetworkAdapterType) 274 return E_POINTER; 275 276 AutoCaller autoCaller (this); 277 CheckComRCReturnRC (autoCaller.rc()); 278 279 /* mNetworkAdapterType is constant during life time, no need to lock */ 280 *aNetworkAdapterType = mNetworkAdapterType; 281 282 return S_OK; 283 } -
trunk/src/VBox/Main/MachineImpl.cpp
r14579 r14664 366 366 * @param aName name for the machine when aMode is Init_New 367 367 * (ignored otherwise) 368 * @param aOsType OS Type of this machine 368 369 * @param aNameSync |TRUE| to automatically sync settings dir and file 369 370 * name with the machine name. |FALSE| is used for legacy … … 381 382 HRESULT Machine::init (VirtualBox *aParent, const BSTR aConfigFile, 382 383 InitMode aMode, const BSTR aName /* = NULL */, 384 GuestOSType *aOsType /* = NULL */, 383 385 BOOL aNameSync /* = TRUE */, 384 386 const Guid *aId /* = NULL */) … … 492 494 rc = COMSETTER(SnapshotFolder) (NULL); 493 495 AssertComRC (rc); 496 497 if (aOsType) 498 { 499 /* Store os type */ 500 mUserData->mOSTypeId = aOsType->id(); 501 502 /* Apply other machine defaults */ 503 mHWData->mHWVirtExEnabled = aOsType->recommendedVirtEx() ? TSBool_True : TSBool_False; 504 505 /* Apply BIOS defaults */ 506 mBIOSSettings->applyDefaults (aOsType); 507 508 /* Apply network adapters defaults */ 509 for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); ++ slot) 510 mNetworkAdapters [slot]->applyDefaults (aOsType); 511 } 494 512 } 495 513 -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r14579 r14664 23 23 #include "Logging.h" 24 24 #include "MachineImpl.h" 25 #include "GuestOSTypeImpl.h" 25 26 26 27 #include <iprt/string.h> … … 1299 1300 } 1300 1301 1302 void NetworkAdapter::applyDefaults (GuestOSType *aOsType) 1303 { 1304 if (!aOsType) 1305 return; 1306 1307 bool e1000enabled = false; 1308 #ifdef VBOX_WITH_E1000 1309 e1000enabled = true; 1310 #endif // VBOX_WITH_E1000 1311 1312 NetworkAdapterType_T defaultType = aOsType->networkAdapterType(); 1313 1314 /* Set default network adapter for this OS type */ 1315 if (defaultType == NetworkAdapterType_I82540EM || 1316 defaultType == NetworkAdapterType_I82543GC) 1317 { 1318 if (e1000enabled) mData->mAdapterType = defaultType; 1319 } 1320 else mData->mAdapterType = defaultType; 1321 1322 /* Enable and connect the first one adapter to the NAT */ 1323 if (mData->mSlot == 0) 1324 { 1325 mData->mEnabled = true; 1326 mData->mAttachmentType = NetworkAttachmentType_NAT; 1327 mData->mCableConnected = true; 1328 } 1329 } 1330 1301 1331 // private methods 1302 1332 //////////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r14579 r14664 268 268 Global::sOSTypes [i].osType, 269 269 Global::sOSTypes [i].is64Bit, 270 Global::sOSTypes [i].recommendedIOAPIC, 271 Global::sOSTypes [i].recommendedVirtEx, 270 272 Global::sOSTypes [i].recommendedRAM, 271 273 Global::sOSTypes [i].recommendedVRAM, 272 Global::sOSTypes [i].recommendedHDD); 274 Global::sOSTypes [i].recommendedHDD, 275 Global::sOSTypes [i].networkAdapterType); 273 276 if (SUCCEEDED (rc)) 274 277 mData.mGuestOSTypes.push_back (guestOSTypeObj); … … 751 754 752 755 /** @note Locks mSystemProperties object for reading. */ 753 STDMETHODIMP VirtualBox::CreateMachine (INPTR BSTR aBaseFolder, 754 INPTR BSTR aName, 756 STDMETHODIMP VirtualBox::CreateMachine (INPTR BSTR aName, 757 INPTR BSTR aOsTypeId, 758 INPTR BSTR aBaseFolder, 755 759 INPTR GUIDPARAM aId, 756 760 IMachine **aMachine) … … 802 806 id.create(); 803 807 808 /* Look for related GuestOsType */ 809 AssertMsg (mData.mGuestOSTypes.size(), ("Guest OS types array must be filled")); 810 GuestOSTypeList::iterator it = mData.mGuestOSTypes.begin(); 811 GuestOSType *osType = *it; 812 while (aOsTypeId && it != mData.mGuestOSTypes.end()) 813 { 814 if ((*it)->id() == aOsTypeId) 815 { 816 osType = *it; 817 break; 818 } 819 ++ it; 820 } 821 804 822 /* initialize the machine object */ 805 rc = machine->init (this, settingsFile, Machine::Init_New, aName, TRUE, &id);823 rc = machine->init (this, settingsFile, Machine::Init_New, aName, osType, TRUE, &id); 806 824 if (SUCCEEDED (rc)) 807 825 { … … 818 836 } 819 837 820 STDMETHODIMP VirtualBox::CreateLegacyMachine (INPTR BSTR aSettingsFile, 821 INPTR BSTR aName, 838 STDMETHODIMP VirtualBox::CreateLegacyMachine (INPTR BSTR aName, 839 INPTR BSTR aOsTypeId, 840 INPTR BSTR aSettingsFile, 822 841 INPTR GUIDPARAM aId, 823 842 IMachine **aMachine) … … 856 875 id.create(); 857 876 877 /* Look for related GuestOsType */ 878 AssertMsg (mData.mGuestOSTypes.size(), ("Guest OS types array must be filled")); 879 GuestOSTypeList::iterator it = mData.mGuestOSTypes.begin(); 880 GuestOSType *osType = *it; 881 while (aOsTypeId && it != mData.mGuestOSTypes.end()) 882 { 883 if ((*it)->id() == aOsTypeId) 884 { 885 osType = *it; 886 break; 887 } 888 ++ it; 889 } 890 858 891 /* initialize the machine object */ 859 892 rc = machine->init (this, Bstr (settingsFile), Machine::Init_New, 860 aName, FALSE /* aNameSync */, &id);893 aName, osType, FALSE /* aNameSync */, &id); 861 894 if (SUCCEEDED (rc)) 862 895 { … … 2994 3027 /* initialize the machine object and register it */ 2995 3028 rc = machine->init (this, src, Machine::Init_Registered, 2996 NULL, FALSE, &uuid);3029 NULL, NULL, FALSE, &uuid); 2997 3030 if (SUCCEEDED (rc)) 2998 3031 rc = registerMachine (machine); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r14644 r14664 1355 1355 </note> 1356 1356 </desc> 1357 <param name="name" type="wstring" dir="in"> 1358 <desc>Machine name.</desc> 1359 </param> 1360 <param name="osTypeId" type="wstring" dir="in"> 1361 <desc>Machine OS Type ID.</desc> 1362 </param> 1357 1363 <param name="baseFolder" type="wstring" dir="in"> 1358 1364 <desc> … … 1360 1366 subfolder containing the settings file. 1361 1367 </desc> 1362 </param>1363 <param name="name" type="wstring" dir="in">1364 <desc>Machine name.</desc>1365 1368 </param> 1366 1369 <param name="id" type="uuid" dir="in"> … … 1424 1427 <param name="name" type="wstring" dir="in"> 1425 1428 <desc>Machine name.</desc> 1429 </param> 1430 <param name="osTypeId" type="wstring" dir="in"> 1431 <desc>Machine OS Type ID.</desc> 1426 1432 </param> 1427 1433 <param name="id" type="uuid" dir="in"> … … 5745 5751 </attribute> 5746 5752 5753 <attribute name="recommendedIOAPIC" type="boolean" readonly="yes"> 5754 <desc>Returns @c true if IO APIC recommended for this OS type.</desc> 5755 </attribute> 5756 5757 <attribute name="recommendedVirtEx" type="boolean" readonly="yes"> 5758 <desc>Returns @c true if VT-x or AMD-V recommended for this OS type.</desc> 5759 </attribute> 5760 5747 5761 <attribute name="recommendedRAM" type="unsigned long" readonly="yes"> 5748 5762 <desc>Recommended RAM size in Megabytes.</desc> … … 5755 5769 <attribute name="recommendedHDD" type="unsigned long" readonly="yes"> 5756 5770 <desc>Recommended hard disk size in Megabytes.</desc> 5771 </attribute> 5772 5773 <attribute name="adapterType" type="NetworkAdapterType" readonly="yes"> 5774 <desc>Returns recommended network adapter for this OS type.</desc> 5757 5775 </attribute> 5758 5776 </interface> -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r8155 r14664 28 28 29 29 class Machine; 30 class GuestOSType; 30 31 31 32 class ATL_NO_VTABLE BIOSSettings : … … 132 133 void commit(); 133 134 void copyFrom (BIOSSettings *aThat); 135 void applyDefaults (GuestOSType *aOsType); 134 136 135 137 // for VirtualBoxSupportErrorInfoImpl -
trunk/src/VBox/Main/include/Global.h
r14437 r14664 27 27 /* generated header */ 28 28 #include "SchemaDefs.h" 29 #include "VirtualBox.h" 29 30 30 31 #include <VBox/ostypes.h> … … 43 44 struct OSType 44 45 { 45 const char *familyId; /* utf-8 */ 46 const char *familyDescription; /* utf-8 */ 47 const char *id; /* utf-8 */ 48 const char *description; /* utf-8 */ 49 const VBOXOSTYPE osType; 50 const bool is64Bit; 51 const uint32_t recommendedRAM; 52 const uint32_t recommendedVRAM; 53 const uint32_t recommendedHDD; 46 const char *familyId; /* utf-8 */ 47 const char *familyDescription; /* utf-8 */ 48 const char *id; /* utf-8 */ 49 const char *description; /* utf-8 */ 50 const VBOXOSTYPE osType; 51 const bool is64Bit; 52 const bool recommendedIOAPIC; 53 const bool recommendedVirtEx; 54 const uint32_t recommendedRAM; 55 const uint32_t recommendedVRAM; 56 const uint32_t recommendedHDD; 57 const NetworkAdapterType_T networkAdapterType; 54 58 }; 55 59 -
trunk/src/VBox/Main/include/GuestOSTypeImpl.h
r14437 r14664 58 58 const char *aId, const char *aDescription, 59 59 VBOXOSTYPE aOSType, bool aIs64Bit, 60 uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize); 60 bool aRecommendedIOAPIC, bool aRecommendedVirtEx, 61 uint32_t aRAMSize, uint32_t aVRAMSize, uint32_t aHDDSize, 62 NetworkAdapterType_T aNetworkAdapterType); 61 63 void uninit(); 62 64 … … 67 69 STDMETHOD(COMGETTER(Description)) (BSTR *aDescription); 68 70 STDMETHOD(COMGETTER(Is64Bit)) (BOOL *aIs64Bit); 71 STDMETHOD(COMGETTER(RecommendedIOAPIC)) (BOOL *aRecommendedIOAPIC); 72 STDMETHOD(COMGETTER(RecommendedVirtEx)) (BOOL *aRecommendedVirtEx); 69 73 STDMETHOD(COMGETTER(RecommendedRAM)) (ULONG *aRAMSize); 70 74 STDMETHOD(COMGETTER(RecommendedVRAM)) (ULONG *aVRAMSize); 71 75 STDMETHOD(COMGETTER(RecommendedHDD)) (ULONG *aHDDSize); 76 STDMETHOD(COMGETTER(AdapterType)) (NetworkAdapterType_T *aNetworkAdapterType); 72 77 73 78 // public methods only for internal purposes 74 79 const Bstr &id() const { return mID; } 80 bool is64Bit() const { return mIs64Bit; } 81 bool recommendedIOAPIC() const { return mRecommendedIOAPIC; } 82 bool recommendedVirtEx() const { return mRecommendedVirtEx; } 83 NetworkAdapterType_T networkAdapterType() const { return mNetworkAdapterType; } 75 84 76 85 // for VirtualBoxSupportErrorInfoImpl … … 85 94 const VBOXOSTYPE mOSType; 86 95 const bool mIs64Bit; 96 const bool mRecommendedIOAPIC; 97 const bool mRecommendedVirtEx; 87 98 const uint32_t mRAMSize; 88 99 const uint32_t mVRAMSize; 89 100 const uint32_t mHDDSize; 90 101 const uint32_t mMonitorCount; 102 const NetworkAdapterType_T mNetworkAdapterType; 91 103 }; 92 104 -
trunk/src/VBox/Main/include/MachineImpl.h
r13962 r14664 460 460 HRESULT init (VirtualBox *aParent, const BSTR aConfigFile, 461 461 InitMode aMode, const BSTR aName = NULL, 462 GuestOSType *aOsType = NULL, 462 463 BOOL aNameSync = TRUE, const Guid *aId = NULL); 463 464 void uninit(); -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r10898 r14664 29 29 30 30 class Machine; 31 class GuestOSType; 31 32 32 33 class ATL_NO_VTABLE NetworkAdapter : … … 162 163 void commit(); 163 164 void copyFrom (NetworkAdapter *aThat); 165 void applyDefaults (GuestOSType *aOsType); 164 166 165 167 // public methods for internal purposes only -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r14143 r14664 137 137 /* IVirtualBox methods */ 138 138 139 STDMETHOD(CreateMachine) (INPTR BSTR a BaseFolder, INPTR BSTR aName,139 STDMETHOD(CreateMachine) (INPTR BSTR aName, INPTR BSTR aOsTypeId, INPTR BSTR aBaseFolder, 140 140 INPTR GUIDPARAM aId, IMachine **aMachine); 141 STDMETHOD(CreateLegacyMachine) (INPTR BSTR a SettingsFile, INPTR BSTR aName,141 STDMETHOD(CreateLegacyMachine) (INPTR BSTR aName, INPTR BSTR aOsTypeId, INPTR BSTR aSettingsFile, 142 142 INPTR GUIDPARAM aId, IMachine **aMachine); 143 143 STDMETHOD(OpenMachine) (INPTR BSTR aSettingsFile, IMachine **aMachine);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器