VirtualBox

Changeset 39248 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 9, 2011 12:29:53 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74778
Message:

Runtime: new guest OS type for Solaris 11
Frontends/VirtualBox: add new patterns for Solaris 11 guest OS type, reuse the icon
Frontends/VBoxManage: more details for "list ostypes"
Main/xml: make guest OS type in config file an arbitrary string (still validated/mapped in the old way in the settings code), remove hardcoded limit of 8 network adapters
Main/Global: move list of valid guest OS types into a single place, add function to get the network adapter limit for each chipset type
Main/Console+Machine+Snapshot+NetworkAdapter+Appliance+VirtualBox+Guest+SystemProperties: consistently use the appropriate network adapter limit so that ICH9 chipset can use 36 network adapters, adapt to cleaned up guest OS type handling, remove leftover rendundant guest OS mapping, whitespace
Network/NAT: release log message cosmetics, allow unlimited number of instances, fix maxconn clamping
Network/PCNet+VirtioNet+E1000: allow unlimited number of instances

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r39242 r39248  
    6969#include "BusAssignmentManager.h"
    7070
    71 // generated header
    72 #include "SchemaDefs.h"
    7371#include "VBoxEvents.h"
    7472#include "AutoCaller.h"
     
    379377    , mMachineState(MachineState_PoweredOff)
    380378{
    381     for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; ++slot)
    382         meAttachmentType[slot] = NetworkAttachmentType_Null;
    383379}
    384380
     
    395391    memset(&mapSharedFolderLed, 0, sizeof(mapSharedFolderLed));
    396392
    397     for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++ i)
     393    for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++i)
    398394        maStorageDevType[i] = DeviceType_Null;
    399395
     
    501497    mcGuestCredentialsProvided = false;
    502498
     499    /* Figure out size of meAttachmentType vector */
     500    ComPtr<IVirtualBox> pVirtualBox;
     501    rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     502    AssertComRC(rc);
     503    ComPtr<ISystemProperties> pSystemProperties;
     504    if (pVirtualBox)
     505        pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
     506    ChipsetType_T chipsetType = ChipsetType_PIIX3;
     507    aMachine->COMGETTER(ChipsetType)(&chipsetType);
     508    ULONG maxNetworkAdapters = 0;
     509    if (pSystemProperties)
     510        pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     511    meAttachmentType.resize(maxNetworkAdapters);
     512    for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; ++slot)
     513        meAttachmentType[slot] = NetworkAttachmentType_Null;
     514
     515
    503516    // VirtualBox 4.0: We no longer initialize the VMMDev instance here,
    504517    // which starts the HGCM thread. Instead, this is now done in the
     
    518531    /* VirtualBox events registration. */
    519532    {
    520         ComPtr<IVirtualBox> pVirtualBox;
    521         rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
    522         AssertComRC(rc);
    523 
    524533        ComPtr<IEventSource> pES;
    525534        rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam());
     
    13291338    for (SharedFolderMap::const_iterator it = that->m_mapSharedFolders.begin();
    13301339         it != that->m_mapSharedFolders.end();
    1331          ++ it)
     1340         ++it)
    13321341    {
    13331342        SharedFolder *pSF = (*it).second;
     
    14091418    AssertRCReturn(vrc, vrc);
    14101419
    1411     for (uint32_t i = 0; i < size; ++ i)
     1420    for (uint32_t i = 0; i < size; ++i)
    14121421    {
    14131422        Utf8Str strName;
     
    28462855            break;
    28472856        }
    2848         ++ it;
     2857        ++it;
    28492858    }
    28502859
     
    44694478    AssertReturn(pThis, VERR_INVALID_PARAMETER);
    44704479
     4480    AutoCaller autoCaller(pThis);
     4481    AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED);
     4482
     4483    ComPtr<IVirtualBox> pVirtualBox;
     4484    pThis->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     4485    ComPtr<ISystemProperties> pSystemProperties;
     4486    if (pVirtualBox)
     4487        pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
     4488    ChipsetType_T chipsetType = ChipsetType_PIIX3;
     4489    pThis->mMachine->COMGETTER(ChipsetType)(&chipsetType);
     4490    ULONG maxNetworkAdapters = 0;
     4491    if (pSystemProperties)
     4492        pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
    44714493    AssertMsg(   (   !strcmp(pszDevice, "pcnet")
    44724494                  || !strcmp(pszDevice, "e1000")
    44734495                  || !strcmp(pszDevice, "virtio-net"))
    44744496              && uLun == 0
    4475               && uInstance < SchemaDefs::NetworkAdapterCount,
     4497              && uInstance < maxNetworkAdapters,
    44764498              ("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance));
    44774499    Log(("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance));
    4478 
    4479     AutoCaller autoCaller(pThis);
    4480     AssertComRCReturn(autoCaller.rc(), VERR_ACCESS_DENIED);
    44814500
    44824501    /*
     
    49945013            break;
    49955014        }
    4996         ++ it;
     5015        ++it;
    49975016    }
    49985017
     
    60046023            Utf8Str oldName, newName;
    60056024
    6006             for (unsigned int j = 0; j < RT_ELEMENTS(files); ++ j)
     6025            for (unsigned int j = 0; j < RT_ELEMENTS(files); ++j)
    60076026            {
    60086027                if (i > 0)
     
    62316250        /* the network cards will undergo a quick consistency check */
    62326251        for (ULONG slot = 0;
    6233              slot < SchemaDefs::NetworkAdapterCount;
     6252             slot < maxNetworkAdapters;
    62346253             ++slot)
    62356254        {
     
    66716690    /* advance percent count */
    66726691    if (aProgress)
    6673         aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6692        aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount );
    66746693
    66756694
     
    67016720    /* advance percent count */
    67026721    if (aProgress)
    6703         aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6722        aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount );
    67046723
    67056724    vrc = VINF_SUCCESS;
     
    67266745    /* advance percent count */
    67276746    if (aProgress)
    6728         aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6747        aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount );
    67296748
    67306749#ifdef VBOX_WITH_HGCM
     
    67446763    /* advance percent count */
    67456764    if (aProgress)
    6746         aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6765        aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount);
    67476766
    67486767#endif /* VBOX_WITH_HGCM */
     
    67906809        /* advance percent count */
    67916810        if (aProgress)
    6792             aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6811            aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount);
    67936812
    67946813        if (RT_SUCCESS(vrc))
     
    68206839        /* advance percent count */
    68216840        if (aProgress)
    6822             aProgress->SetCurrentOperationProgress(99 * (++ step) / StepCount );
     6841            aProgress->SetCurrentOperationProgress(99 * (++step) / StepCount);
    68236842    }
    68246843    else
     
    70477066            {
    70487067                for (SharedFolderDataMap::const_iterator it = oldFolders.begin();
    7049                      it != oldFolders.end(); ++ it)
     7068                     it != oldFolders.end(); ++it)
    70507069                {
    70517070                    if (m_mapSharedFolders.find(it->first) != m_mapSharedFolders.end())
     
    80868105     * host interface termination handling
    80878106     */
    8088     HRESULT rc;
    8089     for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; slot ++)
     8107    HRESULT rc = S_OK;
     8108    ComPtr<IVirtualBox> pVirtualBox;
     8109    mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     8110    ComPtr<ISystemProperties> pSystemProperties;
     8111    if (pVirtualBox)
     8112        pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
     8113    ChipsetType_T chipsetType = ChipsetType_PIIX3;
     8114    mMachine->COMGETTER(ChipsetType)(&chipsetType);
     8115    ULONG maxNetworkAdapters = 0;
     8116    if (pSystemProperties)
     8117        pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     8118
     8119    for (ULONG slot = 0; slot < maxNetworkAdapters; slot++)
    80908120    {
    80918121        ComPtr<INetworkAdapter> pNetworkAdapter;
     
    83938423            }
    83948424
    8395             ++ it;
     8425            ++it;
    83968426        }
    83978427
     
    84988528        for (VMPowerUpTask::ProgressList::const_iterator
    84998529             it = task->hardDiskProgresses.begin();
    8500              it != task->hardDiskProgresses.end(); ++ it)
     8530             it != task->hardDiskProgresses.end(); ++it)
    85018531        {
    85028532            HRESULT rc2 = (*it)->WaitForCompletion(-1);
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r38873 r39248  
    756756    BOOL fOsXGuest = guestTypeFamilyId == Bstr("MacOS");
    757757
     758    ULONG maxNetworkAdapters;
     759    hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);        H();
    758760    /*
    759761     * Get root node first.
     
    17101712#endif /* VBOX_WITH_VIRTIO */
    17111713        std::list<BootNic> llBootNics;
    1712         for (ULONG ulInstance = 0; ulInstance < SchemaDefs::NetworkAdapterCount; ++ulInstance)
     1714        for (ULONG ulInstance = 0; ulInstance < maxNetworkAdapters; ++ulInstance)
    17131715        {
    17141716            ComPtr<INetworkAdapter> networkAdapter;
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r37930 r39248  
    141141/////////////////////////////////////////////////////////////////////////////
    142142
    143 STDMETHODIMP Guest::COMGETTER(OSTypeId) (BSTR *aOSTypeId)
     143STDMETHODIMP Guest::COMGETTER(OSTypeId)(BSTR *aOSTypeId)
    144144{
    145145    CheckComArgOutPointerValid(aOSTypeId);
     
    602602     * its real status when using new(er) Guest Additions.
    603603     */
    604     mData.mOSTypeId = Global::OSTypeId (aOsType);
     604    mData.mOSTypeId = Global::OSTypeId(aOsType);
    605605}
    606606
Note: See TracChangeset for help on using the changeset viewer.

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