VirtualBox

Changeset 16231 in vbox


Ignore:
Timestamp:
Jan 26, 2009 1:43:24 PM (16 years ago)
Author:
vboxsync
Message:

OVF: formating; todo updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16228 r16231  
    944944
    945945        /* CPU count (ignored for now) */
     946        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */
    946947        // list<VirtualSystemDescriptionEntry> vsdeCPU = vsd->findByType (VirtualSystemDescriptionType_CPU);
    947948
    948949        /* RAM */
     950        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */
    949951        list<VirtualSystemDescriptionEntry> vsdeRAM = vsd->findByType (VirtualSystemDescriptionType_Memory);
    950952        Assert (vsdeRAM.size() == 1);
    951953        string memoryVBox = vsdeRAM.front().strFinalValue;
    952         uint32_t tt = RTStrToUInt32 (memoryVBox.c_str()) / _1M;
     954        uint64_t tt = RTStrToUInt64 (memoryVBox.c_str()) / _1M;
    953955
    954956        rc = newMachine->COMSETTER(MemorySize)(tt);
     
    956958
    957959        /* VRAM */
    958         /* Get the recommended VRAM for this guest os type */
     960        /* Get the recommended VRAM for this guest OS type */
     961        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestVRAM) */
    959962        ULONG vramVBox;
    960963        rc = osType->COMGETTER(RecommendedVRAM) (&vramVBox);
     
    978981        {
    979982            list<VirtualSystemDescriptionEntry>::const_iterator nwIt;
     983            /* Iterate through all network cards. We support 8 network adapters
     984             * at the maximum. (@todo: warn if it are more!) */
    980985            size_t a = 0;
    981986            for (nwIt = vsdeNW.begin();
    982                  (nwIt != vsdeNW.end() && a < 9);
     987                 (nwIt != vsdeNW.end() && a < SchemaDefs::NetworkAdapterCount);
    983988                 ++nwIt, ++a)
    984989            {
     
    12381243        if (nameVBox == "")
    12391244            nameVBox = osTypeVBox;
    1240         /* @todo: make sure the name is unique (add some numbers if not) */
    12411245        searchUniqueVMName (nameVBox);
    1242         vsd->addEntry(VirtualSystemDescriptionType_Name, 0, nameVBox, nameVBox);
     1246        vsd->addEntry (VirtualSystemDescriptionType_Name, 0, vs.strName, nameVBox);
    12431247
    12441248        /* Now that we know the base system get our internal defaults based on that. */
     
    12481252
    12491253        /* CPU count */
     1254        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */
    12501255        ULONG cpuCountVBox = vs.cCPUs;
    12511256        if (vs.cCPUs == 0)
     
    12541259
    12551260        /* RAM */
     1261        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */
    12561262        uint64_t ullMemSizeVBox = vs.ullMemorySize; /** @todo r=bird/MSC: this will overflow at 4GB, use 64-bit type. */
    12571263        if (vs.ullMemorySize == 0)
     
    12811287                        /* Use PIIX4 as default */
    12821288                        IDEControllerType_T hdcController = IDEControllerType_PIIX4;
    1283                         if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3"))
     1289                        if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX3"))
    12841290                            hdcController = IDEControllerType_PIIX3;
    1285                         else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4"))
     1291                        else if (!RTStrICmp (hdc.strControllerType.c_str(), "PIIX4"))
    12861292                            hdcController = IDEControllerType_PIIX4;
    12871293                        vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerIDE, hdc.idController, hdc.strControllerType, toString<ULONG> (hdcController));
     
    12991305                        string hdcController = "LsiLogic";
    13001306                        // @todo: figure out the SCSI types
    1301                         if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic"))
     1307                        if (!RTStrICmp (hdc.strControllerType.c_str(), "LsiLogic"))
    13021308                            hdcController = "LsiLogic";
    1303                         else if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic"))
     1309                        else if (!RTStrICmp (hdc.strControllerType.c_str(), "BusLogic"))
    13041310                            hdcController = "BusLogic";
    13051311                        vsd->addEntry (VirtualSystemDescriptionType_HarddiskControllerSCSI, hdc.idController, hdc.strControllerType, hdcController);
     
    13161322            //  - check that the filename is unique to vbox in any case
    13171323            list<VirtualDisk>::const_iterator hdIt;
    1318             /* Iterate through all hard disks */
     1324            /* Iterate through all hard disks ()*/
    13191325            for (hdIt = vs.llVirtualDisks.begin();
    13201326                 hdIt != vs.llVirtualDisks.end();
     
    13301336                //  - figure out if there is a url specifier for vhd already
    13311337                //  - we need a url specifier for the vdi format
    1332                 if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
     1338                if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
    13331339                    fSupported = true;
    13341340                /* enable compressed formats for the first tests also */
    1335                 else if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
     1341                else if (!RTStrICmp (di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
    13361342                    fSupported = true;
    13371343                if (fSupported)
     
    13481354        if (vs.llNetworkNames.size() > 0)
    13491355        {
    1350             /* Get the default network adapter type for the selected guest os */
     1356            /* Get the default network adapter type for the selected guest OS */
    13511357            NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A;
    13521358            rc = osType->COMGETTER(AdapterType) (&nwAdapterVBox);
    13531359            ComAssertComRCThrowRC (rc);
    13541360            list<string>::const_iterator nwIt;
    1355             /* Iterate through all abstract networks */
     1361            /* Iterate through all abstract networks. We support 8 network
     1362             * adapters at the maximum. (@todo: warn if it are more!) */
     1363            size_t a = 0;
    13561364            for (nwIt = vs.llNetworkNames.begin();
    1357                  nwIt != vs.llNetworkNames.end();
    1358                  ++nwIt)
     1365                 nwIt != vs.llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount;
     1366                 ++nwIt, ++a)
    13591367            {
    13601368                // string nwController = *nwIt; // @todo: not used yet
Note: See TracChangeset for help on using the changeset viewer.

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