VirtualBox

儲存庫 vbox 的更動 14664


忽略:
時間撮記:
2008-11-26 下午09:19:35 (16 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
39973
訊息:

Main & FEs: 3002: GUI/Main enhancements for 64 bits guests implemented.

位置:
trunk/src/VBox
檔案:
修改 17 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r14646 r14664  
    318318    {
    319319        RTPrintf("VBoxManage createvm         -name <name>\n"
     320                 "                            [-ostype <ostype>]\n"
    320321                 "                            [-register]\n"
    321322                 "                            [-basefolder <path> | -settingsfile <path>]\n"
     
    13451346    Bstr settingsFile;
    13461347    Bstr name;
     1348    Bstr osTypeId;
    13471349    RTUUID id;
    13481350    bool fRegister = false;
     
    13721374            name = argv[i];
    13731375        }
     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        }
    13741383        else if (strcmp(argv[i], "-uuid") == 0)
    13751384        {
     
    13991408        if (!settingsFile)
    14001409            CHECK_ERROR_BREAK(virtualBox,
    1401                 CreateMachine(baseFolder, name, Guid(id), machine.asOutParam()));
     1410                CreateMachine(name, osTypeId, baseFolder, Guid(id), machine.asOutParam()));
    14021411        else
    14031412            CHECK_ERROR_BREAK(virtualBox,
    1404                 CreateLegacyMachine(settingsFile, name, Guid(id), machine.asOutParam()));
     1413                CreateLegacyMachine(name, osTypeId, settingsFile, Guid(id), machine.asOutParam()));
    14051414
    14061415        CHECK_ERROR_BREAK(machine, SaveSettings());
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h

    r13580 r14664  
    291291    CVirtualBox vbox = vboxGlobal().virtualBox();
    292292
     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
    293298    /* create a machine with the default settings file location */
    294299    if (mMachine.isNull())
    295300    {
    296         mMachine = vbox.CreateMachine (QString(), leName->text(), QUuid());
     301        mMachine = vbox.CreateMachine (leName->text(), typeId, QString::null, QUuid());
    297302        if (!vbox.isOk())
    298303        {
     
    308313    }
    309314
    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 
    324315    /* RAM size */
    325316    mMachine.SetMemorySize (slRAM->value());
    326 
    327     /* add one network adapter (NAT) by default */
    328     {
    329         CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);
    330 #ifdef VBOX_WITH_E1000
    331         /* 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     }
    342317
    343318    /* register the VM prior to attaching hard disks */
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r14652 r14664  
    52625262    {
    52635263        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. */
    52645272        while (en.HasMore())
    52655273        {
     
    52735281            mTypes [mFamilyIDs.indexOf (familyId)].append (os);
    52745282        }
     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);
    52755291    }
    52765292
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp

    r14442 r14664  
    303303    CVirtualBox vbox = vboxGlobal().virtualBox();
    304304
     305    /* OS type */
     306    CGuestOSType type = mOSTypeSelector->type();
     307    AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
     308    QString typeId = type.GetId();
     309
    305310    /* Create a machine with the default settings file location */
    306311    if (mMachine.isNull())
    307312    {
    308         mMachine = vbox.CreateMachine (QString(), mLeName->text(), QUuid());
     313        mMachine = vbox.CreateMachine (mLeName->text(), typeId, QString::null, QUuid());
    309314        if (!vbox.isOk())
    310315        {
     
    320325    }
    321326
    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 
    336327    /* RAM size */
    337328    mMachine.SetMemorySize (mSlRAM->value());
     
    340331    mMachine.SetVRAMSize (qMax (type.GetRecommendedVRAM(),
    341332                                (ULONG) (VBoxGlobal::requiredVideoMemory() / _1M)));
    342 
    343     /* Add one network adapter (NAT) by default */
    344     {
    345         CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);
    346 #ifdef VBOX_WITH_E1000
    347         /* 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     }
    357333
    358334    /* Register the VM prior to attaching hard disks */
  • trunk/src/VBox/Main/BIOSSettingsImpl.cpp

    r14579 r14664  
    2323#include "MachineImpl.h"
    2424#include "Logging.h"
     25#include "GuestOSTypeImpl.h"
    2526#include <iprt/cpputils.h>
    2627
     
    730731}
    731732
     733void 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  
    3434     * NOTE2: please use powers of 2 when specifying the size of harddisks since
    3535     *        '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 },
    3638    { "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 },
    3840    { "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 },
    4042    { "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 },
    4244    { "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 },
    4446    { "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 },
    4648    { "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 },
    4850    { "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 },
    5052    { "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 },
    5254    { "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 },
    5456    { "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 },
    5658    { "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 },
    5860    { "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 },
    6062    { "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 },
    6264    { "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 },
    6466    { "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 },
    6668    { "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 },
    6870    { "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 },
    7072    { "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 },
    7274    { "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 },
    7476    { "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 },
    7678    { "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 },
    7880    { "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 },
    8082    { "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 },
    8284    { "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 },
    8486    { "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 },
    8688    { "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 },
    8890    { "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 },
    9092    { "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 },
    9294    { "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 },
    9496    { "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 },
    9698    { "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 },
    98100    { "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 },
    100102    { "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 },
    102104    { "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 },
    104106    { "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 },
    106108    { "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 },
    108110    { "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 },
    110112    { "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 },
    112114    { "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 },
    114116    { "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 },
    116118    { "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 },
    118120    { "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 },
    120122    { "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 },
    122124    { "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 },
    124126    { "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 },
    126128    { "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 },
    128130    { "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 },
    130132    { "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 },
    132134    { "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 },
    134136    { "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 },
    136138    { "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 },
    138140    { "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 },
    140142    { "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 },
    142144    { "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 },
    144146    { "Other",   "Other",             SchemaDefs_OSTypeId_DOS,             "DOS",
    145       VBOXOSTYPE_DOS,             false,  32,   4,      512 },
     147      VBOXOSTYPE_DOS,             false, false, false,  32,   4,      512, NetworkAdapterType_Am79C973 },
    146148    { "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 },
    148150    { "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 }
    152152};
    153153
  • trunk/src/VBox/Main/GuestOSTypeImpl.cpp

    r14579 r14664  
    3030    : mOSType (VBOXOSTYPE_Unknown)
    3131    , mIs64Bit (false)
     32    , mRecommendedIOAPIC (false)
     33    , mRecommendedVirtEx (false)
    3234    , mRAMSize (0), mVRAMSize (0)
    3335    , mHDDSize (0), mMonitorCount (0)
     36    , mNetworkAdapterType (NetworkAdapterType_Am79C973)
    3437{
    3538}
     
    6972                           const char *aId, const char *aDescription,
    7073                           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)
    7277{
    7378    LogFlowThisFunc (("aFamilyId='%s', aFamilyDescription='%s', "
    7479                      "aId='%s', aDescription='%s', "
    7580                      "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",
    7784                      aFamilyId, aFamilyDescription,
    7885                      aId, aDescription,
    7986                      aOSType, aIs64Bit,
    80                       aRAMSize, aVRAMSize, aHDDSize));
     87                      aRecommendedIOAPIC, aRecommendedVirtEx,
     88                      aRAMSize, aVRAMSize, aHDDSize,
     89                      aNetworkAdapterType));
    8190
    8291    ComAssertRet (aFamilyId && aFamilyDescription && aId && aDescription, E_INVALIDARG);
     
    92101    unconst (mOSType) = aOSType;
    93102    unconst (mIs64Bit) = aIs64Bit;
     103    unconst (mRecommendedIOAPIC) = aRecommendedIOAPIC;
     104    unconst (mRecommendedVirtEx) = aRecommendedVirtEx;
    94105    unconst (mRAMSize) = aRAMSize;
    95106    unconst (mVRAMSize) = aVRAMSize;
    96107    unconst (mHDDSize) = aHDDSize;
     108    unconst (mNetworkAdapterType) = aNetworkAdapterType;
    97109
    98110    /* Confirm a successful initialization when it's the case */
     
    187199}
    188200
     201STDMETHODIMP 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
     215STDMETHODIMP 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
    189229STDMETHODIMP GuestOSType::COMGETTER(RecommendedRAM) (ULONG *aRAMSize)
    190230{
     
    228268    return S_OK;
    229269}
     270
     271STDMETHODIMP 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  
    366366 *  @param aName        name for the machine when aMode is Init_New
    367367 *                      (ignored otherwise)
     368 *  @param aOsType      OS Type of this machine
    368369 *  @param aNameSync    |TRUE| to automatically sync settings dir and file
    369370 *                      name with the machine name. |FALSE| is used for legacy
     
    381382HRESULT Machine::init (VirtualBox *aParent, const BSTR aConfigFile,
    382383                       InitMode aMode, const BSTR aName /* = NULL */,
     384                       GuestOSType *aOsType /* = NULL */,
    383385                       BOOL aNameSync /* = TRUE */,
    384386                       const Guid *aId /* = NULL */)
     
    492494                rc = COMSETTER(SnapshotFolder) (NULL);
    493495                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                }
    494512            }
    495513
  • trunk/src/VBox/Main/NetworkAdapterImpl.cpp

    r14579 r14664  
    2323#include "Logging.h"
    2424#include "MachineImpl.h"
     25#include "GuestOSTypeImpl.h"
    2526
    2627#include <iprt/string.h>
     
    12991300}
    13001301
     1302void 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
    13011331// private methods
    13021332////////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r14579 r14664  
    268268                                               Global::sOSTypes [i].osType,
    269269                                               Global::sOSTypes [i].is64Bit,
     270                                               Global::sOSTypes [i].recommendedIOAPIC,
     271                                               Global::sOSTypes [i].recommendedVirtEx,
    270272                                               Global::sOSTypes [i].recommendedRAM,
    271273                                               Global::sOSTypes [i].recommendedVRAM,
    272                                                Global::sOSTypes [i].recommendedHDD);
     274                                               Global::sOSTypes [i].recommendedHDD,
     275                                               Global::sOSTypes [i].networkAdapterType);
    273276                    if (SUCCEEDED (rc))
    274277                        mData.mGuestOSTypes.push_back (guestOSTypeObj);
     
    751754
    752755/** @note Locks mSystemProperties object for reading. */
    753 STDMETHODIMP VirtualBox::CreateMachine (INPTR BSTR aBaseFolder,
    754                                         INPTR BSTR aName,
     756STDMETHODIMP VirtualBox::CreateMachine (INPTR BSTR aName,
     757                                        INPTR BSTR aOsTypeId,
     758                                        INPTR BSTR aBaseFolder,
    755759                                        INPTR GUIDPARAM aId,
    756760                                        IMachine **aMachine)
     
    802806            id.create();
    803807
     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
    804822        /* 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);
    806824        if (SUCCEEDED (rc))
    807825        {
     
    818836}
    819837
    820 STDMETHODIMP VirtualBox::CreateLegacyMachine (INPTR BSTR aSettingsFile,
    821                                               INPTR BSTR aName,
     838STDMETHODIMP VirtualBox::CreateLegacyMachine (INPTR BSTR aName,
     839                                              INPTR BSTR aOsTypeId,
     840                                              INPTR BSTR aSettingsFile,
    822841                                              INPTR GUIDPARAM aId,
    823842                                              IMachine **aMachine)
     
    856875            id.create();
    857876
     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
    858891        /* initialize the machine object */
    859892        rc = machine->init (this, Bstr (settingsFile), Machine::Init_New,
    860                             aName, FALSE /* aNameSync */, &id);
     893                            aName, osType, FALSE /* aNameSync */, &id);
    861894        if (SUCCEEDED (rc))
    862895        {
     
    29943027            /* initialize the machine object and register it */
    29953028            rc = machine->init (this, src, Machine::Init_Registered,
    2996                                 NULL, FALSE, &uuid);
     3029                                NULL, NULL, FALSE, &uuid);
    29973030            if (SUCCEEDED (rc))
    29983031                rc = registerMachine (machine);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14644 r14664  
    13551355        </note>
    13561356      </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>
    13571363      <param name="baseFolder" type="wstring" dir="in">
    13581364        <desc>
     
    13601366          subfolder containing the settings file.
    13611367        </desc>
    1362       </param>
    1363       <param name="name" type="wstring" dir="in">
    1364         <desc>Machine name.</desc>
    13651368      </param>
    13661369      <param name="id" type="uuid" dir="in">
     
    14241427      <param name="name" type="wstring" dir="in">
    14251428        <desc>Machine name.</desc>
     1429      </param>
     1430      <param name="osTypeId" type="wstring" dir="in">
     1431        <desc>Machine OS Type ID.</desc>
    14261432      </param>
    14271433      <param name="id" type="uuid" dir="in">
     
    57455751    </attribute>
    57465752
     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
    57475761    <attribute name="recommendedRAM" type="unsigned long" readonly="yes">
    57485762      <desc>Recommended RAM size in Megabytes.</desc>
     
    57555769    <attribute name="recommendedHDD" type="unsigned long" readonly="yes">
    57565770      <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>
    57575775    </attribute>
    57585776  </interface>
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r8155 r14664  
    2828
    2929class Machine;
     30class GuestOSType;
    3031
    3132class ATL_NO_VTABLE BIOSSettings :
     
    132133    void commit();
    133134    void copyFrom (BIOSSettings *aThat);
     135    void applyDefaults (GuestOSType *aOsType);
    134136
    135137    // for VirtualBoxSupportErrorInfoImpl
  • trunk/src/VBox/Main/include/Global.h

    r14437 r14664  
    2727/* generated header */
    2828#include "SchemaDefs.h"
     29#include "VirtualBox.h"
    2930
    3031#include <VBox/ostypes.h>
     
    4344    struct OSType
    4445    {
    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;
    5458    };
    5559
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r14437 r14664  
    5858                  const char *aId, const char *aDescription,
    5959                  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);
    6163    void uninit();
    6264
     
    6769    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
    6870    STDMETHOD(COMGETTER(Is64Bit)) (BOOL *aIs64Bit);
     71    STDMETHOD(COMGETTER(RecommendedIOAPIC)) (BOOL *aRecommendedIOAPIC);
     72    STDMETHOD(COMGETTER(RecommendedVirtEx)) (BOOL *aRecommendedVirtEx);
    6973    STDMETHOD(COMGETTER(RecommendedRAM)) (ULONG *aRAMSize);
    7074    STDMETHOD(COMGETTER(RecommendedVRAM)) (ULONG *aVRAMSize);
    7175    STDMETHOD(COMGETTER(RecommendedHDD)) (ULONG *aHDDSize);
     76    STDMETHOD(COMGETTER(AdapterType)) (NetworkAdapterType_T *aNetworkAdapterType);
    7277
    7378    // public methods only for internal purposes
    7479    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; }
    7584
    7685    // for VirtualBoxSupportErrorInfoImpl
     
    8594    const VBOXOSTYPE mOSType;
    8695    const bool mIs64Bit;
     96    const bool mRecommendedIOAPIC;
     97    const bool mRecommendedVirtEx;
    8798    const uint32_t mRAMSize;
    8899    const uint32_t mVRAMSize;
    89100    const uint32_t mHDDSize;
    90101    const uint32_t mMonitorCount;
     102    const NetworkAdapterType_T mNetworkAdapterType;
    91103};
    92104
  • trunk/src/VBox/Main/include/MachineImpl.h

    r13962 r14664  
    460460    HRESULT init (VirtualBox *aParent, const BSTR aConfigFile,
    461461                  InitMode aMode, const BSTR aName = NULL,
     462                  GuestOSType *aOsType = NULL,
    462463                  BOOL aNameSync = TRUE, const Guid *aId = NULL);
    463464    void uninit();
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r10898 r14664  
    2929
    3030class Machine;
     31class GuestOSType;
    3132
    3233class ATL_NO_VTABLE NetworkAdapter :
     
    162163    void commit();
    163164    void copyFrom (NetworkAdapter *aThat);
     165    void applyDefaults (GuestOSType *aOsType);
    164166
    165167    // public methods for internal purposes only
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r14143 r14664  
    137137    /* IVirtualBox methods */
    138138
    139     STDMETHOD(CreateMachine) (INPTR BSTR aBaseFolder, INPTR BSTR aName,
     139    STDMETHOD(CreateMachine) (INPTR BSTR aName, INPTR BSTR aOsTypeId, INPTR BSTR aBaseFolder,
    140140                              INPTR GUIDPARAM aId, IMachine **aMachine);
    141     STDMETHOD(CreateLegacyMachine) (INPTR BSTR aSettingsFile, INPTR BSTR aName,
     141    STDMETHOD(CreateLegacyMachine) (INPTR BSTR aName, INPTR BSTR aOsTypeId, INPTR BSTR aSettingsFile,
    142142                                    INPTR GUIDPARAM aId, IMachine **aMachine);
    143143    STDMETHOD(OpenMachine) (INPTR BSTR aSettingsFile, IMachine **aMachine);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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