VirtualBox

Changeset 16495 in vbox


Ignore:
Timestamp:
Feb 3, 2009 9:20:36 PM (16 years ago)
Author:
vboxsync
Message:

OVF: VBoxManage import implementation (to be continued), back-end fixes, documentation updates

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/string.h

    r16384 r16495  
    513513
    514514    /**
     515     * Attempts to convert the member string into an unsigned 64-bit integer.
     516     * @return IPRT error code.
     517     * @param i Output buffer.
     518     */
     519    int toInt(uint64_t &i) const;
     520
     521    /**
     522     * Attempts to convert the member string into an unsigned 32-bit integer.
     523     * @return IPRT error code.
     524     * @param i Output buffer.
     525     */
     526    int toInt(uint32_t &i) const;
     527
     528    /**
    515529     *  Intended to pass instances as out (|char **|) parameters to methods.
    516530     *  Takes the ownership of the returned data.
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp

    r16491 r16495  
    2525*   Header Files                                                               *
    2626*******************************************************************************/
     27#ifndef VBOX_ONLY_DOCS
     28#include <VBox/com/com.h>
     29#include <VBox/com/string.h>
     30#include <VBox/com/Guid.h>
     31#include <VBox/com/array.h>
     32#include <VBox/com/ErrorInfo.h>
     33#include <VBox/com/EventQueue.h>
     34
     35#include <VBox/com/VirtualBox.h>
     36
     37#include <list>
     38#endif /* !VBOX_ONLY_DOCS */
     39
     40#include <iprt/stream.h>
     41
     42#include <VBox/log.h>
     43
    2744#include "VBoxManage.h"
    2845using namespace com;
     
    3148// funcs
    3249///////////////////////////////////////////////////////////////////////////////
    33 
    34 
    3550
    3651int handleImportAppliance(HandlerArg *a)
     
    3853    HRESULT rc = S_OK;
    3954
     55    Utf8Str strOvfFilename;
     56
     57    for (int i = 0; i < a->argc; i++)
     58    {
     59        if (!strOvfFilename)
     60            strOvfFilename = a->argv[i];
     61        else
     62            return errorSyntax(USAGE_IMPORTAPPLIANCE, "Too many arguments for \"import\" command.");
     63    }
     64
     65    if (!strOvfFilename)
     66        return errorSyntax(USAGE_IMPORTAPPLIANCE, "Not enough arguments for \"import\" command.");
     67
     68    do
     69    {
     70        Bstr bstrOvfFilename(strOvfFilename);
     71        ComPtr<IAppliance> appliance;
     72        CHECK_ERROR_BREAK(a->virtualBox, OpenAppliance(bstrOvfFilename, appliance.asOutParam()));
     73
     74        RTPrintf("Interpreting...\n");
     75        CHECK_ERROR_BREAK(appliance, Interpret());
     76        RTPrintf("OK.\n");
     77
     78        // fetch all disks
     79        com::SafeArray<BSTR> retDisks;
     80        CHECK_ERROR_BREAK(appliance,
     81                          COMGETTER(Disks)(ComSafeArrayAsOutParam(retDisks)));
     82        if (retDisks.size() > 0)
     83        {
     84            RTPrintf("Disks:");
     85            for (unsigned i = 0; i < retDisks.size(); i++)
     86                RTPrintf("  %ls", retDisks[i]);
     87            RTPrintf("\n");
     88        }
     89
     90        // fetch virtual system descriptions
     91        com::SafeIfaceArray<IVirtualSystemDescription> aVirtualSystemDescriptions;
     92        CHECK_ERROR_BREAK(appliance,
     93                          COMGETTER(VirtualSystemDescriptions)(ComSafeArrayAsOutParam(aVirtualSystemDescriptions)));
     94        if (aVirtualSystemDescriptions.size() > 0)
     95        {
     96            for (unsigned i = 0; i < aVirtualSystemDescriptions.size(); ++i)
     97            {
     98                com::SafeArray<VirtualSystemDescriptionType_T> retTypes;
     99                com::SafeArray<ULONG> aRefs;
     100                com::SafeArray<BSTR> aOrigValues;
     101                com::SafeArray<BSTR> aConfigValues;
     102                com::SafeArray<BSTR> aExtraConfigValues;
     103                CHECK_ERROR_BREAK(aVirtualSystemDescriptions[i],
     104                                  GetDescription(ComSafeArrayAsOutParam(retTypes),
     105                                                 ComSafeArrayAsOutParam(aRefs),
     106                                                 ComSafeArrayAsOutParam(aOrigValues),
     107                                                 ComSafeArrayAsOutParam(aConfigValues),
     108                                                 ComSafeArrayAsOutParam(aExtraConfigValues)));
     109
     110                RTPrintf("Virtual system %i:\n", i);
     111                for (unsigned a = 0; a < retTypes.size(); ++a)
     112                {
     113                    VirtualSystemDescriptionType_T t = retTypes[a];
     114
     115                    Bstr bstrVMname;
     116                    Bstr bstrOstype;
     117                    uint32_t ulMemMB;
     118                    bool fUSB = false;
     119
     120                    switch (t)
     121                    {
     122                        case VirtualSystemDescriptionType_Name:
     123                            bstrVMname = aConfigValues[a];
     124                            RTPrintf("%2d: Suggested VM name \"%ls\""
     125                                     "\n    (change with \"-vsys %d -vmname <name>\")\n",
     126                                     a, bstrVMname.raw(), i);
     127                        break;
     128
     129                        case VirtualSystemDescriptionType_OS:
     130                            bstrOstype = aConfigValues[a];
     131                            RTPrintf("%2d: Suggested OS type: \"%ls\""
     132                                     "\n    (change with \"-vsys %d -ostype <type>\"; use \"list ostypes\" to list all)\n",
     133                                     a, bstrOstype.raw(), i);
     134                        break;
     135
     136                        case VirtualSystemDescriptionType_CPU:
     137                            RTPrintf("%2d: Number of CPUs (ignored): %ls\n",
     138                                     a, aConfigValues[a]);
     139                        break;
     140
     141                        case VirtualSystemDescriptionType_Memory:
     142                            Utf8Str(Bstr(aConfigValues[a])).toInt(ulMemMB);
     143                            ulMemMB /= 1024 * 1024;
     144                            RTPrintf("%2d: Guest memory: %u MB\n    (change with \"-vsys %d -memory <MB>\")\n",
     145                                     a, ulMemMB, i);
     146                        break;
     147
     148                        case VirtualSystemDescriptionType_HardDiskControllerIDE:
     149                            RTPrintf("%2d: IDE controller: reference ID %d"
     150                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     151                                     a,
     152                                     aRefs[a],
     153                                     i, a);
     154                        break;
     155
     156                        case VirtualSystemDescriptionType_HardDiskControllerSATA:
     157                            RTPrintf("%2d: SATA controller: reference ID %d"
     158                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     159                                     a,
     160                                     aRefs[a],
     161                                     i, a);
     162                        break;
     163
     164                        case VirtualSystemDescriptionType_HardDiskControllerSCSI:
     165                            RTPrintf("%2d: SCSI controller: reference ID %d, type %ls"
     166                                     "\n    (change with \"-vsys %d -scsitype%d={BusLogic|LsiLogic}\";"
     167                                     "\n    disable with \"-vsys %d -ignore %d\")\n",
     168                                     a,
     169                                     aRefs[a],
     170                                     aConfigValues[a],
     171                                     i, a, i, a);
     172                        break;
     173
     174                        case VirtualSystemDescriptionType_HardDiskImage:
     175                            RTPrintf("%2d: Hard disk image: controller %d, source image \"%ls\", target image \"%ls\""
     176                                     "\n    (change controller with \"-vsys %d -controller%d=<id>\";"
     177                                     "\n    disable with \"-vsys %d -ignore %d\")\n",
     178                                     a,
     179                                     aRefs[a],
     180                                     aOrigValues[a],
     181                                     aConfigValues[a],
     182                                     i, a, i, a);
     183                        break;
     184
     185                        case VirtualSystemDescriptionType_CDROM:
     186                            RTPrintf("%2d: CD-ROM"
     187                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     188                                     a, i, a);
     189                        break;
     190
     191                        case VirtualSystemDescriptionType_Floppy:
     192                            RTPrintf("%2d: Floppy"
     193                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     194                                     a, i, a);
     195                        break;
     196
     197                        case VirtualSystemDescriptionType_NetworkAdapter:
     198                            RTPrintf("%2d: Network adapter: orig %ls, auto %ls, conf %ls\n",
     199                                     a,
     200                                     aOrigValues[a],
     201                                     aConfigValues[a],
     202                                     aExtraConfigValues[a]);
     203                        break;
     204
     205                        case VirtualSystemDescriptionType_USBController:
     206                            RTPrintf("%2d: USB controller"
     207                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     208                                     a, i, a);
     209                        break;
     210
     211                        case VirtualSystemDescriptionType_SoundCard:
     212                            RTPrintf("%2d: Sound card (appliance expects \"%ls\", can change on import)"
     213                                     "\n    (disable with \"-vsys %d -ignore %d\")\n",
     214                                     a,
     215                                     aOrigValues[a],
     216                                     i,
     217                                     a);
     218                        break;
     219                    }
     220                }
     221            }
     222            RTPrintf("\n");
     223        }
     224    } while (0);
     225
    40226    return SUCCEEDED(rc) ? 0 : 1;
    41227}
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r16362 r16495  
    108108};
    109109
    110 typedef map<Utf8Str, DiskImage> DiskImagesMap;
     110typedef map<uint32_t, DiskImage> DiskImagesMap;
    111111typedef map<Utf8Str, Network> NetworksMap;
    112112
     
    129129typedef map<uint32_t, VirtualHardwareItem> HardwareItemsMap;
    130130
    131 enum ControllerSystemType { IDE, SATA, SCSI };
    132131struct HardDiskController
    133132{
    134133    uint32_t             idController;           // instance ID (Item/InstanceId); this gets referenced from HardDisk
    135     ControllerSystemType controllerSystem;       // one of IDE, SATA, SCSI
     134    enum ControllerSystemType { IDE, SATA, SCSI };
     135    ControllerSystemType system;                 // one of IDE, SATA, SCSI
    136136    Utf8Str              strControllerType;      // controllertype (Item/ResourceSubType); e.g. "LsiLogic"; can be empty (esp. for IDE)
    137137    Utf8Str              strAddress;             // for IDE
     
    446446                                              const xml::Node *pelmVirtualSystem)
    447447{
    448     VirtualSystem d;
     448    VirtualSystem vsys;
    449449
    450450    const xml::Node *pIdAttr = pelmVirtualSystem->findAttribute("id");
    451451    if (pIdAttr)
    452         d.strName = pIdAttr->getValue();
     452        vsys.strName = pIdAttr->getValue();
    453453
    454454    xml::NodesLoop loop(*pelmVirtualSystem);      // all child elements
     
    472472               )
    473473            {
    474                 d.strLicenceInfo = pelmInfo->getValue();
    475                 d.strLicenceText = pelmLicense->getValue();
     474                vsys.strLicenceInfo = pelmInfo->getValue();
     475                vsys.strLicenceText = pelmLicense->getValue();
    476476            }
    477477        }
     
    491491                </System>*/
    492492                if ((pelmVirtualSystemType = pelmSystem->findChildElement("VirtualSystemType")))
    493                     d.strVirtualSystemType = pelmVirtualSystemType->getValue();
     493                    vsys.strVirtualSystemType = pelmVirtualSystemType->getValue();
    494494            }
    495495
     
    568568
    569569                // store!
    570                 d.mapHardwareItems[i.ulInstanceID] = i;
     570                vsys.mapHardwareItems[i.ulInstanceID] = i;
    571571            }
    572572
    573573            HardwareItemsMap::const_iterator itH;
    574574
    575             for (itH = d.mapHardwareItems.begin();
    576                  itH != d.mapHardwareItems.end();
     575            for (itH = vsys.mapHardwareItems.begin();
     576                 itH != vsys.mapHardwareItems.end();
    577577                 ++itH)
    578578            {
     
    590590                            <rasd:VirtualQuantity>1</rasd:VirtualQuantity>*/
    591591                        if (i.ullVirtualQuantity < UINT16_MAX)
    592                             d.cCPUs = (uint16_t)i.ullVirtualQuantity;
     592                            vsys.cCPUs = (uint16_t)i.ullVirtualQuantity;
    593593                        else
    594594                            return setError(VBOX_E_FILE_ERROR,
     
    605605                             || (i.strAllocationUnits == "byte * 2^20")         // suggested by OVF spec DSP0243 page 21
    606606                           )
    607                             d.ullMemorySize = i.ullVirtualQuantity * 1024 * 1024;
     607                            vsys.ullMemorySize = i.ullVirtualQuantity * 1024 * 1024;
    608608                        else
    609609                            return setError(VBOX_E_FILE_ERROR,
     
    625625                            </Item> */
    626626                        HardDiskController hdc;
     627                        hdc.system = HardDiskController::IDE;
    627628                        hdc.idController = i.ulInstanceID;
    628                         hdc.controllerSystem = IDE;
    629629                        hdc.strAddress = i.strAddress;
    630630                        hdc.ulBusNumber = i.ulBusNumber;
    631631
    632                         d.mapControllers[i.ulInstanceID] = hdc;
     632                        vsys.mapControllers[i.ulInstanceID] = hdc;
    633633                    }
     634                    break;
    634635
    635636                    case OVFResourceType_ParallelScsiHba:        // 6       SCSI controller
     
    644645                            </Item> */
    645646                        HardDiskController hdc;
     647                        hdc.system = HardDiskController::SCSI;
    646648                        hdc.idController = i.ulInstanceID;
    647                         hdc.controllerSystem = SCSI;
    648649                        hdc.strControllerType = i.strResourceSubType;
    649650
    650                         d.mapControllers[i.ulInstanceID] = hdc;
     651                        vsys.mapControllers[i.ulInstanceID] = hdc;
    651652                    }
    652653                    break;
     
    680681                                            i.ulLineNumber);
    681682
    682                         d.llNetworkNames.push_back(i.strConnection);
     683                        vsys.llNetworkNames.push_back(i.strConnection);
    683684                    }
    684685                    break;
    685686
    686687                    case OVFResourceType_FloppyDrive: // 14
    687                         d.fHasFloppyDrive = true;           // we have no additional information
     688                        vsys.fHasFloppyDrive = true;           // we have no additional information
    688689                    break;
    689690
     
    700701                            // but then the ovftool dies with "Device backing not supported". So I guess if
    701702                            // VMware can't export ISOs, then we don't need to be able to import them right now.
    702                         d.fHasCdromDrive = true;           // we have no additional information
     703                        vsys.fHasCdromDrive = true;           // we have no additional information
    703704                    break;
    704705
     
    717718                        // look up the hard disk controller element whose InstanceID equals our Parent;
    718719                        // this is how the connection is specified in OVF
    719                         ControllersMap::const_iterator it = d.mapControllers.find(i.ulParent);
    720                         if (it == d.mapControllers.end())
     720                        ControllersMap::const_iterator it = vsys.mapControllers.find(i.ulParent);
     721                        if (it == vsys.mapControllers.end())
    721722                            return setError(VBOX_E_FILE_ERROR,
    722723                                            tr("Error reading \"%s\": Hard disk item with instance ID %d specifies invalid parent %d, line %d"),
     
    747748                                            i.ulLineNumber);
    748749
    749                         d.mapVirtualDisks[vd.strDiskId] = vd;
     750                        vsys.mapVirtualDisks[vd.strDiskId] = vd;
    750751                    }
    751752                    break;
     
    760761                                <rasd:BusNumber>0</rasd:BusNumber>
    761762                            </Item> */
    762                         d.fHasUsbController = true;           // we have no additional information
     763                        vsys.fHasUsbController = true;           // we have no additional information
    763764                    break;
    764765
     
    773774                                <rasd:AddressOnParent>3</rasd:AddressOnParent>
    774775                            </Item> */
    775                         d.strSoundCardType = i.strResourceSubType;
     776                        vsys.strSoundCardType = i.strResourceSubType;
    776777                    break;
    777778
     
    796797                                pelmThis->getLineNumber());
    797798
    798             d.cimos = (CIMOSType_T)cimos64;
     799            vsys.cimos = (CIMOSType_T)cimos64;
    799800        }
    800801    }
    801802
    802803    // now create the virtual system
    803     m->llVirtualSystems.push_back(d);
     804    m->llVirtualSystems.push_back(vsys);
    804805
    805806    return S_OK;
     
    972973}
    973974
     975void convertCIMOSType2VBoxOSType(Utf8Str &osTypeVBox, CIMOSType_T c)
     976{
     977    switch (c)
     978    {
     979        case CIMOSType_CIMOS_Unknown: // 0 - Unknown
     980            osTypeVBox = SchemaDefs_OSTypeId_Other;
     981            break;
     982
     983        case CIMOSType_CIMOS_OS2: // 12 - OS/2
     984            osTypeVBox = SchemaDefs_OSTypeId_OS2;
     985            break;
     986
     987        case CIMOSType_CIMOS_MSDOS: // 14 - MSDOS
     988            osTypeVBox = SchemaDefs_OSTypeId_DOS;
     989            break;
     990
     991        case CIMOSType_CIMOS_WIN3x: // 15 - WIN3x
     992            osTypeVBox = SchemaDefs_OSTypeId_Windows31;
     993            break;
     994
     995        case CIMOSType_CIMOS_WIN95: // 16 - WIN95
     996            osTypeVBox = SchemaDefs_OSTypeId_Windows95;
     997            break;
     998
     999        case CIMOSType_CIMOS_WIN98: // 17 - WIN98
     1000            osTypeVBox = SchemaDefs_OSTypeId_Windows98;
     1001            break;
     1002
     1003        case CIMOSType_CIMOS_WINNT: // 18 - WINNT
     1004            osTypeVBox = SchemaDefs_OSTypeId_WindowsNT4;
     1005            break;
     1006
     1007        case CIMOSType_CIMOS_NetWare: // 21 - NetWare
     1008        case CIMOSType_CIMOS_NovellOES: // 86 - Novell OES
     1009            osTypeVBox = SchemaDefs_OSTypeId_Netware;
     1010            break;
     1011
     1012        case CIMOSType_CIMOS_Solaris: // 29 - Solaris
     1013        case CIMOSType_CIMOS_SunOS: // 30 - SunOS
     1014            osTypeVBox = SchemaDefs_OSTypeId_Solaris;
     1015            break;
     1016
     1017        case CIMOSType_CIMOS_FreeBSD: // 42 - FreeBSD
     1018            osTypeVBox = SchemaDefs_OSTypeId_FreeBSD;
     1019            break;
     1020
     1021        case CIMOSType_CIMOS_NetBSD: // 43 - NetBSD
     1022            osTypeVBox = SchemaDefs_OSTypeId_NetBSD;
     1023            break;
     1024
     1025        case CIMOSType_CIMOS_QNX: // 48 - QNX
     1026            osTypeVBox = SchemaDefs_OSTypeId_QNX;
     1027            break;
     1028
     1029        case CIMOSType_CIMOS_Windows2000: // 58 - Windows 2000
     1030            osTypeVBox = SchemaDefs_OSTypeId_Windows2000;
     1031            break;
     1032
     1033        case CIMOSType_CIMOS_WindowsMe: // 63 - Windows (R) Me
     1034            osTypeVBox = SchemaDefs_OSTypeId_WindowsMe;
     1035            break;
     1036
     1037        case CIMOSType_CIMOS_OpenBSD: // 65 - OpenBSD
     1038            osTypeVBox = SchemaDefs_OSTypeId_OpenBSD;
     1039            break;
     1040
     1041        case CIMOSType_CIMOS_WindowsXP: // 67 - Windows XP
     1042        case CIMOSType_CIMOS_WindowsXPEmbedded: // 72 - Windows XP Embedded
     1043        case CIMOSType_CIMOS_WindowsEmbeddedforPointofService: // 75 - Windows Embedded for Point of Service
     1044            osTypeVBox = SchemaDefs_OSTypeId_WindowsXP;
     1045            break;
     1046
     1047        case CIMOSType_CIMOS_MicrosoftWindowsServer2003: // 69 - Microsoft Windows Server 2003
     1048            osTypeVBox = SchemaDefs_OSTypeId_Windows2003;
     1049            break;
     1050
     1051        case CIMOSType_CIMOS_MicrosoftWindowsServer2003_64: // 70 - Microsoft Windows Server 2003 64-Bit
     1052            osTypeVBox = SchemaDefs_OSTypeId_Windows2003_64;
     1053            break;
     1054
     1055        case CIMOSType_CIMOS_WindowsXP_64: // 71 - Windows XP 64-Bit
     1056            osTypeVBox = SchemaDefs_OSTypeId_WindowsXP_64;
     1057            break;
     1058
     1059        case CIMOSType_CIMOS_WindowsVista: // 73 - Windows Vista
     1060            osTypeVBox = SchemaDefs_OSTypeId_WindowsVista;
     1061            break;
     1062
     1063        case CIMOSType_CIMOS_WindowsVista_64: // 74 - Windows Vista 64-Bit
     1064            osTypeVBox = SchemaDefs_OSTypeId_WindowsVista_64;
     1065            break;
     1066
     1067        case CIMOSType_CIMOS_MicrosoftWindowsServer2008: // 76 - Microsoft Windows Server 2008
     1068            osTypeVBox = SchemaDefs_OSTypeId_Windows2008;
     1069            break;
     1070
     1071        case CIMOSType_CIMOS_MicrosoftWindowsServer2008_64: // 77 - Microsoft Windows Server 2008 64-Bit
     1072            osTypeVBox = SchemaDefs_OSTypeId_Windows2008_64;
     1073            break;
     1074
     1075        case CIMOSType_CIMOS_FreeBSD_64: // 78 - FreeBSD 64-Bit
     1076            osTypeVBox = SchemaDefs_OSTypeId_FreeBSD_64;
     1077            break;
     1078
     1079        case CIMOSType_CIMOS_RedHatEnterpriseLinux: // 79 - RedHat Enterprise Linux
     1080            osTypeVBox = SchemaDefs_OSTypeId_RedHat;
     1081            break;
     1082
     1083        case CIMOSType_CIMOS_RedHatEnterpriseLinux_64: // 80 - RedHat Enterprise Linux 64-Bit
     1084            osTypeVBox = SchemaDefs_OSTypeId_RedHat_64;
     1085            break;
     1086
     1087        case CIMOSType_CIMOS_Solaris_64: // 81 - Solaris 64-Bit
     1088            osTypeVBox = SchemaDefs_OSTypeId_Solaris_64;
     1089            break;
     1090
     1091        case CIMOSType_CIMOS_SUSE: // 82 - SUSE
     1092        case CIMOSType_CIMOS_SLES: // 84 - SLES
     1093        case CIMOSType_CIMOS_NovellLinuxDesktop: // 87 - Novell Linux Desktop
     1094            osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE;
     1095            break;
     1096
     1097        case CIMOSType_CIMOS_SUSE_64: // 83 - SUSE 64-Bit
     1098        case CIMOSType_CIMOS_SLES_64: // 85 - SLES 64-Bit
     1099            osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE_64;
     1100            break;
     1101
     1102        case CIMOSType_CIMOS_LINUX: // 36 - LINUX
     1103        case CIMOSType_CIMOS_SunJavaDesktopSystem: // 88 - Sun Java Desktop System
     1104        case CIMOSType_CIMOS_TurboLinux: // 91 - TurboLinux
     1105            osTypeVBox = SchemaDefs_OSTypeId_Linux;
     1106            break;
     1107
     1108            //                case CIMOSType_CIMOS_TurboLinux_64: // 92 - TurboLinux 64-Bit
     1109            //                case CIMOSType_CIMOS_Linux_64: // 101 - Linux 64-Bit
     1110            //                    osTypeVBox = VBOXOSTYPE_Linux_x64;
     1111            //                    break;
     1112
     1113        case CIMOSType_CIMOS_Mandriva: // 89 - Mandriva
     1114            osTypeVBox = SchemaDefs_OSTypeId_Mandriva;
     1115            break;
     1116
     1117        case CIMOSType_CIMOS_Mandriva_64: // 90 - Mandriva 64-Bit
     1118            osTypeVBox = SchemaDefs_OSTypeId_Mandriva_64;
     1119            break;
     1120
     1121        case CIMOSType_CIMOS_Ubuntu: // 93 - Ubuntu
     1122            osTypeVBox = SchemaDefs_OSTypeId_Ubuntu;
     1123            break;
     1124
     1125        case CIMOSType_CIMOS_Ubuntu_64: // 94 - Ubuntu 64-Bit
     1126            osTypeVBox = SchemaDefs_OSTypeId_Ubuntu_64;
     1127            break;
     1128
     1129        case CIMOSType_CIMOS_Debian: // 95 - Debian
     1130            osTypeVBox = SchemaDefs_OSTypeId_Debian;
     1131            break;
     1132
     1133        case CIMOSType_CIMOS_Debian_64: // 96 - Debian 64-Bit
     1134            osTypeVBox = SchemaDefs_OSTypeId_Debian_64;
     1135            break;
     1136
     1137        case CIMOSType_CIMOS_Linux_2_4_x: // 97 - Linux 2.4.x
     1138            osTypeVBox = SchemaDefs_OSTypeId_Linux24;
     1139            break;
     1140
     1141        case CIMOSType_CIMOS_Linux_2_4_x_64: // 98 - Linux 2.4.x 64-Bit
     1142            osTypeVBox = SchemaDefs_OSTypeId_Linux24_64;
     1143            break;
     1144
     1145        case CIMOSType_CIMOS_Linux_2_6_x: // 99 - Linux 2.6.x
     1146            osTypeVBox = SchemaDefs_OSTypeId_Linux26;
     1147            break;
     1148
     1149        case CIMOSType_CIMOS_Linux_2_6_x_64: // 100 - Linux 2.6.x 64-Bit
     1150            osTypeVBox = SchemaDefs_OSTypeId_Linux26_64;
     1151            break;
     1152        default:
     1153            {
     1154                /* If we are here we have no clue what OS this should be. Set to
     1155                    * other type as default. */
     1156                osTypeVBox = SchemaDefs_OSTypeId_Other;
     1157            }
     1158    }
     1159}
     1160
    9741161STDMETHODIMP Appliance::Interpret()
    9751162{
     
    9921179    rc = mVirtualBox->COMGETTER(SystemProperties)(systemProps.asOutParam());
    9931180    ComAssertComRCThrowRC(rc);
    994     BSTR defaultHardDiskLocation;
    995     rc = systemProps->COMGETTER(DefaultHardDiskFolder)(&defaultHardDiskLocation);
     1181    Bstr bstrDefaultHardDiskLocation;
     1182    rc = systemProps->COMGETTER(DefaultHardDiskFolder)(bstrDefaultHardDiskLocation.asOutParam());
    9961183    ComAssertComRCThrowRC(rc);
    9971184
     
    10021189         ++it)
    10031190    {
    1004         const VirtualSystem &vs = *it;
    1005         ComObjPtr <VirtualSystemDescription> vsd;
    1006         vsd.createObject();
    1007         rc = vsd->init();
     1191        const VirtualSystem &vsysThis = *it;
     1192
     1193        ComObjPtr<VirtualSystemDescription> pNewDesc;
     1194        pNewDesc.createObject();
     1195        rc = pNewDesc->init();
    10081196        ComAssertComRCThrowRC(rc);
    10091197
    1010         Utf8Str osTypeVBox = SchemaDefs_OSTypeId_Other;
    10111198        /* Guest OS type */
    1012         switch (vs.cimos)
    1013         {
    1014             case CIMOSType_CIMOS_Unknown: // 0 - Unknown
    1015                 osTypeVBox = SchemaDefs_OSTypeId_Other;
    1016                 break;
    1017 
    1018             case CIMOSType_CIMOS_OS2: // 12 - OS/2
    1019                 osTypeVBox = SchemaDefs_OSTypeId_OS2;
    1020                 break;
    1021 
    1022             case CIMOSType_CIMOS_MSDOS: // 14 - MSDOS
    1023                 osTypeVBox = SchemaDefs_OSTypeId_DOS;
    1024                 break;
    1025 
    1026             case CIMOSType_CIMOS_WIN3x: // 15 - WIN3x
    1027                 osTypeVBox = SchemaDefs_OSTypeId_Windows31;
    1028                 break;
    1029 
    1030             case CIMOSType_CIMOS_WIN95: // 16 - WIN95
    1031                 osTypeVBox = SchemaDefs_OSTypeId_Windows95;
    1032                 break;
    1033 
    1034             case CIMOSType_CIMOS_WIN98: // 17 - WIN98
    1035                 osTypeVBox = SchemaDefs_OSTypeId_Windows98;
    1036                 break;
    1037 
    1038             case CIMOSType_CIMOS_WINNT: // 18 - WINNT
    1039                 osTypeVBox = SchemaDefs_OSTypeId_WindowsNT4;
    1040                 break;
    1041 
    1042             case CIMOSType_CIMOS_NetWare: // 21 - NetWare
    1043             case CIMOSType_CIMOS_NovellOES: // 86 - Novell OES
    1044                 osTypeVBox = SchemaDefs_OSTypeId_Netware;
    1045                 break;
    1046 
    1047             case CIMOSType_CIMOS_Solaris: // 29 - Solaris
    1048             case CIMOSType_CIMOS_SunOS: // 30 - SunOS
    1049                 osTypeVBox = SchemaDefs_OSTypeId_Solaris;
    1050                 break;
    1051 
    1052             case CIMOSType_CIMOS_FreeBSD: // 42 - FreeBSD
    1053                 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD;
    1054                 break;
    1055 
    1056             case CIMOSType_CIMOS_NetBSD: // 43 - NetBSD
    1057                 osTypeVBox = SchemaDefs_OSTypeId_NetBSD;
    1058                 break;
    1059 
    1060             case CIMOSType_CIMOS_QNX: // 48 - QNX
    1061                 osTypeVBox = SchemaDefs_OSTypeId_QNX;
    1062                 break;
    1063 
    1064             case CIMOSType_CIMOS_Windows2000: // 58 - Windows 2000
    1065                 osTypeVBox = SchemaDefs_OSTypeId_Windows2000;
    1066                 break;
    1067 
    1068             case CIMOSType_CIMOS_WindowsMe: // 63 - Windows (R) Me
    1069                 osTypeVBox = SchemaDefs_OSTypeId_WindowsMe;
    1070                 break;
    1071 
    1072             case CIMOSType_CIMOS_OpenBSD: // 65 - OpenBSD
    1073                 osTypeVBox = SchemaDefs_OSTypeId_OpenBSD;
    1074                 break;
    1075 
    1076             case CIMOSType_CIMOS_WindowsXP: // 67 - Windows XP
    1077             case CIMOSType_CIMOS_WindowsXPEmbedded: // 72 - Windows XP Embedded
    1078             case CIMOSType_CIMOS_WindowsEmbeddedforPointofService: // 75 - Windows Embedded for Point of Service
    1079                 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP;
    1080                 break;
    1081 
    1082             case CIMOSType_CIMOS_MicrosoftWindowsServer2003: // 69 - Microsoft Windows Server 2003
    1083                 osTypeVBox = SchemaDefs_OSTypeId_Windows2003;
    1084                 break;
    1085 
    1086             case CIMOSType_CIMOS_MicrosoftWindowsServer2003_64: // 70 - Microsoft Windows Server 2003 64-Bit
    1087                 osTypeVBox = SchemaDefs_OSTypeId_Windows2003_64;
    1088                 break;
    1089 
    1090             case CIMOSType_CIMOS_WindowsXP_64: // 71 - Windows XP 64-Bit
    1091                 osTypeVBox = SchemaDefs_OSTypeId_WindowsXP_64;
    1092                 break;
    1093 
    1094             case CIMOSType_CIMOS_WindowsVista: // 73 - Windows Vista
    1095                 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista;
    1096                 break;
    1097 
    1098             case CIMOSType_CIMOS_WindowsVista_64: // 74 - Windows Vista 64-Bit
    1099                 osTypeVBox = SchemaDefs_OSTypeId_WindowsVista_64;
    1100                 break;
    1101 
    1102             case CIMOSType_CIMOS_MicrosoftWindowsServer2008: // 76 - Microsoft Windows Server 2008
    1103                 osTypeVBox = SchemaDefs_OSTypeId_Windows2008;
    1104                 break;
    1105 
    1106             case CIMOSType_CIMOS_MicrosoftWindowsServer2008_64: // 77 - Microsoft Windows Server 2008 64-Bit
    1107                 osTypeVBox = SchemaDefs_OSTypeId_Windows2008_64;
    1108                 break;
    1109 
    1110             case CIMOSType_CIMOS_FreeBSD_64: // 78 - FreeBSD 64-Bit
    1111                 osTypeVBox = SchemaDefs_OSTypeId_FreeBSD_64;
    1112                 break;
    1113 
    1114             case CIMOSType_CIMOS_RedHatEnterpriseLinux: // 79 - RedHat Enterprise Linux
    1115                 osTypeVBox = SchemaDefs_OSTypeId_RedHat;
    1116                 break;
    1117 
    1118             case CIMOSType_CIMOS_RedHatEnterpriseLinux_64: // 80 - RedHat Enterprise Linux 64-Bit
    1119                 osTypeVBox = SchemaDefs_OSTypeId_RedHat_64;
    1120                 break;
    1121 
    1122             case CIMOSType_CIMOS_Solaris_64: // 81 - Solaris 64-Bit
    1123                 osTypeVBox = SchemaDefs_OSTypeId_Solaris_64;
    1124                 break;
    1125 
    1126             case CIMOSType_CIMOS_SUSE: // 82 - SUSE
    1127             case CIMOSType_CIMOS_SLES: // 84 - SLES
    1128             case CIMOSType_CIMOS_NovellLinuxDesktop: // 87 - Novell Linux Desktop
    1129                 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE;
    1130                 break;
    1131 
    1132             case CIMOSType_CIMOS_SUSE_64: // 83 - SUSE 64-Bit
    1133             case CIMOSType_CIMOS_SLES_64: // 85 - SLES 64-Bit
    1134                 osTypeVBox = SchemaDefs_OSTypeId_OpenSUSE_64;
    1135                 break;
    1136 
    1137             case CIMOSType_CIMOS_LINUX: // 36 - LINUX
    1138             case CIMOSType_CIMOS_SunJavaDesktopSystem: // 88 - Sun Java Desktop System
    1139             case CIMOSType_CIMOS_TurboLinux: // 91 - TurboLinux
    1140                 osTypeVBox = SchemaDefs_OSTypeId_Linux;
    1141                 break;
    1142 
    1143                 //                case CIMOSType_CIMOS_TurboLinux_64: // 92 - TurboLinux 64-Bit
    1144                 //                case CIMOSType_CIMOS_Linux_64: // 101 - Linux 64-Bit
    1145                 //                    osTypeVBox = VBOXOSTYPE_Linux_x64;
    1146                 //                    break;
    1147 
    1148             case CIMOSType_CIMOS_Mandriva: // 89 - Mandriva
    1149                 osTypeVBox = SchemaDefs_OSTypeId_Mandriva;
    1150                 break;
    1151 
    1152             case CIMOSType_CIMOS_Mandriva_64: // 90 - Mandriva 64-Bit
    1153                 osTypeVBox = SchemaDefs_OSTypeId_Mandriva_64;
    1154                 break;
    1155 
    1156             case CIMOSType_CIMOS_Ubuntu: // 93 - Ubuntu
    1157                 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu;
    1158                 break;
    1159 
    1160             case CIMOSType_CIMOS_Ubuntu_64: // 94 - Ubuntu 64-Bit
    1161                 osTypeVBox = SchemaDefs_OSTypeId_Ubuntu_64;
    1162                 break;
    1163 
    1164             case CIMOSType_CIMOS_Debian: // 95 - Debian
    1165                 osTypeVBox = SchemaDefs_OSTypeId_Debian;
    1166                 break;
    1167 
    1168             case CIMOSType_CIMOS_Debian_64: // 96 - Debian 64-Bit
    1169                 osTypeVBox = SchemaDefs_OSTypeId_Debian_64;
    1170                 break;
    1171 
    1172             case CIMOSType_CIMOS_Linux_2_4_x: // 97 - Linux 2.4.x
    1173                 osTypeVBox = SchemaDefs_OSTypeId_Linux24;
    1174                 break;
    1175 
    1176             case CIMOSType_CIMOS_Linux_2_4_x_64: // 98 - Linux 2.4.x 64-Bit
    1177                 osTypeVBox = SchemaDefs_OSTypeId_Linux24_64;
    1178                 break;
    1179 
    1180             case CIMOSType_CIMOS_Linux_2_6_x: // 99 - Linux 2.6.x
    1181                 osTypeVBox = SchemaDefs_OSTypeId_Linux26;
    1182                 break;
    1183 
    1184             case CIMOSType_CIMOS_Linux_2_6_x_64: // 100 - Linux 2.6.x 64-Bit
    1185                 osTypeVBox = SchemaDefs_OSTypeId_Linux26_64;
    1186                 break;
    1187             default:
    1188                 {
    1189                     /* If we are here we have no clue what OS this should be. Set to
    1190                      * other type as default. */
    1191                     osTypeVBox = SchemaDefs_OSTypeId_Other;
    1192                 }
    1193         }
    1194         vsd->addEntry(VirtualSystemDescriptionType_OS, "", toString<ULONG>(vs.cimos), osTypeVBox);
     1199        Utf8Str strOsTypeVBox,
     1200                strCIMOSType = toString<ULONG>(vsysThis.cimos);
     1201        convertCIMOSType2VBoxOSType(strOsTypeVBox, vsysThis.cimos);
     1202        pNewDesc->addEntry(VirtualSystemDescriptionType_OS,
     1203                      0,
     1204                      strCIMOSType,
     1205                      strOsTypeVBox);
    11951206
    11961207        /* VM name */
    11971208        /* If the there isn't any name specified create a default one out of
    11981209         * the OS type */
    1199         Utf8Str nameVBox = vs.strName;
     1210        Utf8Str nameVBox = vsysThis.strName;
    12001211        if (nameVBox == "")
    1201             nameVBox = osTypeVBox;
     1212            nameVBox = strOsTypeVBox;
    12021213        searchUniqueVMName(nameVBox);
    1203         vsd->addEntry(VirtualSystemDescriptionType_Name, "", vs.strName, nameVBox);
    1204 
    1205         /* Now that we know the base system get our internal defaults based on that. */
    1206         ComPtr<IGuestOSType> osType;
    1207         rc = mVirtualBox->GetGuestOSType(Bstr(osTypeVBox), osType.asOutParam());
     1214        pNewDesc->addEntry(VirtualSystemDescriptionType_Name,
     1215                           0,
     1216                           vsysThis.strName,
     1217                           nameVBox);
     1218
     1219        /* Now that we know the OS type, get our internal defaults based on that. */
     1220        ComPtr<IGuestOSType> pGuestOSType;
     1221        rc = mVirtualBox->GetGuestOSType(Bstr(strOsTypeVBox), pGuestOSType.asOutParam());
    12081222        ComAssertComRCThrowRC(rc);
    12091223
    12101224        /* CPU count */
    12111225        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxCPUCount) */
    1212         ULONG cpuCountVBox = vs.cCPUs;
    1213         if (vs.cCPUs == 0)
     1226        ULONG cpuCountVBox = vsysThis.cCPUs;
     1227        if (vsysThis.cCPUs == 0)
    12141228            cpuCountVBox = 1;
    1215         vsd->addEntry(VirtualSystemDescriptionType_CPU, "", toString<ULONG>(vs.cCPUs), toString<ULONG>(cpuCountVBox));
     1229        pNewDesc->addEntry(VirtualSystemDescriptionType_CPU,
     1230                           0,
     1231                           toString<ULONG>(vsysThis.cCPUs),
     1232                           toString<ULONG>(cpuCountVBox));
    12161233
    12171234        /* RAM */
    12181235        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */
    1219         uint64_t ullMemSizeVBox = vs.ullMemorySize;
    1220         if (vs.ullMemorySize == 0)
     1236        uint64_t ullMemSizeVBox = vsysThis.ullMemorySize;
     1237        if (vsysThis.ullMemorySize == 0)
    12211238        {
    12221239            /* If the RAM of the OVF is zero, use our predefined values */
    12231240            ULONG memSizeVBox2;
    1224             rc = osType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
     1241            rc = pGuestOSType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
    12251242            ComAssertComRCThrowRC(rc);
    12261243            /* VBox stores that in MByte */
    12271244            ullMemSizeVBox = (uint64_t)memSizeVBox2 * _1M;
    12281245        }
    1229         vsd->addEntry(VirtualSystemDescriptionType_Memory, "", toString<uint64_t>(vs.ullMemorySize), toString<uint64_t>(ullMemSizeVBox));
     1246        pNewDesc->addEntry(VirtualSystemDescriptionType_Memory,
     1247                           0,
     1248                           toString<uint64_t>(vsysThis.ullMemorySize),
     1249                           toString<uint64_t>(ullMemSizeVBox));
    12301250
    12311251        /* Audio */
    1232         if (!vs.strSoundCardType.isNull())
     1252        if (!vsysThis.strSoundCardType.isNull())
    12331253            /* Currently we set the AC97 always.
    12341254               @todo: figure out the hardware which could be possible */
    1235             vsd->addEntry(VirtualSystemDescriptionType_SoundCard, "", vs.strSoundCardType, toString<uint32_t>(AudioControllerType_AC97));
     1255            pNewDesc->addEntry(VirtualSystemDescriptionType_SoundCard,
     1256                               0,
     1257                               vsysThis.strSoundCardType,
     1258                               "");
    12361259
    12371260        /* USB Controller */
    1238         if (vs.fHasUsbController)
    1239             vsd->addEntry(VirtualSystemDescriptionType_USBController, "", "", "1");
     1261        if (vsysThis.fHasUsbController)
     1262            pNewDesc->addEntry(VirtualSystemDescriptionType_USBController, 0, "", "");
    12401263
    12411264        /* Network Controller */
    1242         // @todo: is there no hardware specified in the OVF-Format?
    1243         if (vs.llNetworkNames.size() > 0)
     1265        // @todo: there is no hardware specification in the OVF file; supposedly the
     1266        // hardware will then be determined by the VirtualSystemType element (e.g. "vmx-07")
     1267        if (vsysThis.llNetworkNames.size() > 0)
    12441268        {
    12451269            /* Get the default network adapter type for the selected guest OS */
    12461270            NetworkAdapterType_T nwAdapterVBox = NetworkAdapterType_Am79C970A;
    1247             rc = osType->COMGETTER(AdapterType)(&nwAdapterVBox);
     1271            rc = pGuestOSType->COMGETTER(AdapterType)(&nwAdapterVBox);
    12481272            ComAssertComRCThrowRC(rc);
    12491273            list<Utf8Str>::const_iterator nwIt;
     
    12511275             * adapters at the maximum. (@todo: warn if it are more!) */
    12521276            size_t a = 0;
    1253             for (nwIt = vs.llNetworkNames.begin();
    1254                  nwIt != vs.llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount;
     1277            for (nwIt = vsysThis.llNetworkNames.begin();
     1278                 nwIt != vsysThis.llNetworkNames.end() && a < SchemaDefs::NetworkAdapterCount;
    12551279                 ++nwIt, ++a)
    12561280            {
    1257                 // Utf8Str nwController = *nwIt; // @todo: not used yet
    1258                 vsd->addEntry(VirtualSystemDescriptionType_NetworkAdapter, "", "", toString<ULONG>(nwAdapterVBox));
     1281                Utf8Str nwController = *nwIt; // @todo: not used yet
     1282                pNewDesc->addEntry(VirtualSystemDescriptionType_NetworkAdapter, 0, "", toString<ULONG>(nwAdapterVBox));
    12591283            }
    12601284        }
    12611285
    12621286        /* Floppy Drive */
    1263         if (vs.fHasFloppyDrive)
    1264             vsd->addEntry(VirtualSystemDescriptionType_Floppy, "", "", "1");
     1287        if (vsysThis.fHasFloppyDrive)
     1288            pNewDesc->addEntry(VirtualSystemDescriptionType_Floppy, 0, "", "");
    12651289
    12661290        /* CD Drive */
    1267         /* @todo: I can't disable the CDROM. So nothing to do for now. */
    1268         //if (vs.fHasCdromDrive)
    1269         //    vsd->addEntry(VirtualSystemDescriptionType_CDROM, "", "", "1");
     1291        if (vsysThis.fHasCdromDrive)
     1292           pNewDesc->addEntry(VirtualSystemDescriptionType_CDROM, 0, "", "");
    12701293
    12711294        /* Hard disk Controller */
    12721295        ControllersMap::const_iterator hdcIt;
    12731296        /* Iterate through all hard disk controllers */
    1274         for (hdcIt = vs.mapControllers.begin();
    1275              hdcIt != vs.mapControllers.end();
     1297        for (hdcIt = vsysThis.mapControllers.begin();
     1298             hdcIt != vsysThis.mapControllers.end();
    12761299             ++hdcIt)
    12771300        {
    1278             HardDiskController hdc = hdcIt->second;
    1279             switch (hdc.controllerSystem)
     1301            const HardDiskController &hdc = hdcIt->second;
     1302            switch (hdc.system)
    12801303            {
    1281                 case IDE:
    1282                     {
    1283                         // @todo: figure out the IDE types
    1284                         /* Use PIIX4 as default */
    1285                         IDEControllerType_T hdcController = IDEControllerType_PIIX4;
    1286                         if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3"))
    1287                             hdcController = IDEControllerType_PIIX3;
    1288                         else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4"))
    1289                             hdcController = IDEControllerType_PIIX4;
    1290                         vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, toString<uint32_t>(hdc.idController), hdc.strControllerType, toString<ULONG>(hdcController));
    1291                         break;
    1292                     }
    1293 #ifdef VBOX_WITH_AHCI
    1294                 case SATA:
    1295                     {
    1296                         // @todo: figure out the SATA types
    1297                         /* We only support a plain AHCI controller, so use them always */
    1298                         vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, toString<uint32_t>(hdc.idController), hdc.strControllerType, "AHCI");
    1299                         break;
    1300                     }
    1301 #endif /* VBOX_WITH_AHCI */
    1302 #ifdef VBOX_WITH_SCSI
    1303                 case SCSI:
    1304                     {
    1305                         // @todo: figure out the SCSI types
    1306 # ifdef VBOX_WITH_LSILOGIC
    1307                         Utf8Str hdcController = "LsiLogic";
    1308 # elif VBOX_WITH_BUSLOGIC
    1309                         Utf8Str hdcController = "BusLogic";
    1310 # else /* !VBOX_WITH_BUSLOGIC */
    1311                         Utf8Str hdcController;
    1312 # endif
    1313 # ifdef VBOX_WITH_LSILOGIC
    1314                         if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic"))
    1315                             hdcController = "LsiLogic";
    1316 # endif /* VBOX_WITH_LSILOGIC */
    1317 # ifdef VBOX_WITH_BUSLOGIC
    1318                         if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic"))
    1319                             hdcController = "BusLogic";
    1320 # endif /* VBOX_WITH_BUSLOGIC */
    1321                         vsd->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI, toString<uint32_t>(hdc.idController), hdc.strControllerType, hdcController);
    1322                         break;
    1323                     }
    1324 #endif /* VBOX_WITH_SCSI */
    1325                 default:
    1326                     {
    1327                     /* @todo: hmm, ok, this needs some explanation to the user,
    1328                      * so set an error! The other possibility is to set IDE
    1329                      * PIIX4 as default & redirect all hard disks to this
    1330                      * controller. */
     1304                case HardDiskController::IDE:
     1305                {
     1306                    // @todo: figure out the IDE types
     1307                    /* Use PIIX4 as default */
     1308                    IDEControllerType_T hdcController = IDEControllerType_PIIX4;
     1309                    if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX3"))
     1310                        hdcController = IDEControllerType_PIIX3;
     1311                    else if (!RTStrICmp(hdc.strControllerType.c_str(), "PIIX4"))
     1312                        hdcController = IDEControllerType_PIIX4;
     1313                    pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE,
     1314                                       hdc.idController,
     1315                                       hdc.strControllerType,
     1316                                       toString<ULONG>(hdcController));
    13311317                    break;
    1332                     }
     1318                }
     1319
     1320                case HardDiskController::SATA:
     1321                {
     1322                    // @todo: figure out the SATA types
     1323                    /* We only support a plain AHCI controller, so use them always */
     1324                    pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA,
     1325                                       hdc.idController,
     1326                                       hdc.strControllerType,
     1327                                       "AHCI");
     1328                    break;
     1329                }
     1330
     1331                case HardDiskController::SCSI:
     1332                {
     1333                    // @todo: figure out the SCSI types
     1334                    Utf8Str hdcController = "LsiLogic";
     1335                    if (!RTStrICmp(hdc.strControllerType.c_str(), "LsiLogic"))
     1336                        hdcController = "LsiLogic";
     1337                    else if (!RTStrICmp(hdc.strControllerType.c_str(), "BusLogic"))
     1338                        hdcController = "BusLogic";
     1339                    pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSCSI,
     1340                                       hdc.idController,
     1341                                       hdc.strControllerType,
     1342                                       hdcController);
     1343                    break;
     1344                }
    13331345            }
    13341346        }
    13351347
    13361348        /* Hard disks */
    1337         if (vs.mapVirtualDisks.size() > 0)
     1349        if (vsysThis.mapVirtualDisks.size() > 0)
    13381350        {
    13391351            // @todo:
     
    13421354            VirtualDisksMap::const_iterator hdIt;
    13431355            /* Iterate through all hard disks ()*/
    1344             for (hdIt = vs.mapVirtualDisks.begin();
    1345                  hdIt != vs.mapVirtualDisks.end();
     1356            for (hdIt = vsysThis.mapVirtualDisks.begin();
     1357                 hdIt != vsysThis.mapVirtualDisks.end();
    13461358                 ++hdIt)
    13471359            {
    1348                 VirtualDisk hd = hdIt->second;
     1360                const VirtualDisk &hd = hdIt->second;
    13491361                /* Get the associated disk image */
    1350                 DiskImage di = m->mapDisks [hd.strDiskId];
    1351                 /* We have to check if we support this format */
    1352                 bool fSupported = false;
     1362                const DiskImage &di = m->mapDisks[hd.strDiskId];
     1363
    13531364                // @todo:
    13541365                //  - figure out all possible vmdk formats we also support
    13551366                //  - figure out if there is a url specifier for vhd already
    13561367                //  - we need a url specifier for the vdi format
    1357                 if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
    1358                     fSupported = true;
    1359                 /* enable compressed formats for the first tests also */
    1360                 else if (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
    1361                     fSupported = true;
    1362                 if (fSupported)
     1368                if (    (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#sparse"))
     1369                     || (!RTStrICmp(di.strFormat.c_str(), "http://www.vmware.com/specifications/vmdk.html#compressed"))
     1370                   )
    13631371                {
    13641372                    /* Construct the path */
    1365                     Utf8Str path = Utf8StrFmt("%ls%c%s", defaultHardDiskLocation, RTPATH_DELIMITER, di.strHref.c_str());
     1373                    Utf8StrFmt path("%ls%c%s", bstrDefaultHardDiskLocation.raw(), RTPATH_DELIMITER, di.strHref.c_str());
    13661374                    /* Make the path unique to the VBox installation */
    13671375                    searchUniqueDiskImageFilePath(path);
    1368                     vsd->addEntry(VirtualSystemDescriptionType_HardDiskImage, hd.strDiskId, di.strHref, path);
     1376                    pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage,
     1377                                       hd.idController,
     1378                                       di.strHref,
     1379                                       path);
    13691380                }
    13701381            }
    13711382        }
    13721383
    1373         m->virtualSystemDescriptions.push_back(vsd);
     1384        m->virtualSystemDescriptions.push_back(pNewDesc);
    13741385    }
    13751386
     
    13901401    size_t i = 0;
    13911402    for (it = m->llVirtualSystems.begin(),
    1392          it1 = m->virtualSystemDescriptions.begin();
     1403            it1 = m->virtualSystemDescriptions.begin();
    13931404         it != m->llVirtualSystems.end();
    13941405         ++it, ++it1, ++i)
    13951406    {
    1396         const VirtualSystem &vs = *it;
    1397         ComObjPtr<VirtualSystemDescription> vsd = (*it1);
     1407        const VirtualSystem &vsysThis = *it;
     1408        ComObjPtr<VirtualSystemDescription> vsdescThis = (*it1);
    13981409
    13991410        /* Guest OS type */
    1400         std::list<VirtualSystemDescriptionEntry*> vsdeOS = vsd->findByType(VirtualSystemDescriptionType_OS);
     1411        std::list<VirtualSystemDescriptionEntry*> vsdeOS = vsdescThis->findByType(VirtualSystemDescriptionType_OS);
    14011412        Assert(vsdeOS.size() == 1);
    1402         const Utf8Str &osTypeVBox = vsdeOS.front()->strFinalValue;
     1413        const Utf8Str &osTypeVBox = vsdeOS.front()->strConfig;
    14031414
    14041415        /* Now that we know the base system get our internal defaults based on that. */
     
    14091420        /* Create the machine */
    14101421        /* First get the name */
    1411         std::list<VirtualSystemDescriptionEntry*> vsdeName = vsd->findByType(VirtualSystemDescriptionType_Name);
     1422        std::list<VirtualSystemDescriptionEntry*> vsdeName = vsdescThis->findByType(VirtualSystemDescriptionType_Name);
    14121423        Assert(vsdeName.size() == 1);
    1413         const Utf8Str &nameVBox = vsdeName.front()->strFinalValue;
     1424        const Utf8Str &nameVBox = vsdeName.front()->strConfig;
    14141425        ComPtr<IMachine> newMachine;
    1415         rc = mVirtualBox->CreateMachine(Bstr(nameVBox.c_str()), Bstr(osTypeVBox.c_str()),
     1426        rc = mVirtualBox->CreateMachine(Bstr(nameVBox), Bstr(osTypeVBox),
    14161427                                        Bstr(), Guid(),
    14171428                                        newMachine.asOutParam());
     
    14241435        /* RAM */
    14251436        /* @todo: check min/max requirements of VBox (SchemaDefs::Min/MaxGuestRAM) */
    1426         std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsd->findByType(VirtualSystemDescriptionType_Memory);
     1437        std::list<VirtualSystemDescriptionEntry*> vsdeRAM = vsdescThis->findByType(VirtualSystemDescriptionType_Memory);
    14271438        Assert(vsdeRAM.size() == 1);
    1428         const Utf8Str &memoryVBox = vsdeRAM.front()->strFinalValue;
     1439        const Utf8Str &memoryVBox = vsdeRAM.front()->strConfig;
    14291440        uint64_t tt = RTStrToUInt64(memoryVBox.c_str()) / _1M;
    14301441
     
    14441455
    14451456        /* Audio Adapter */
    1446         std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = vsd->findByType(VirtualSystemDescriptionType_SoundCard);
     1457        std::list<VirtualSystemDescriptionEntry*> vsdeAudioAdapter = vsdescThis->findByType(VirtualSystemDescriptionType_SoundCard);
    14471458        /* @todo: we support one audio adapter only */
    14481459        if (vsdeAudioAdapter.size() > 0)
    14491460        {
    1450             const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->strFinalValue;
     1461            const Utf8Str& audioAdapterVBox = vsdeAudioAdapter.front()->strConfig;
    14511462            if (RTStrICmp(audioAdapterVBox, "null") != 0)
    14521463            {
     
    14901501
    14911502        /* USB Controller */
    1492         std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = vsd->findByType(VirtualSystemDescriptionType_USBController);
     1503        std::list<VirtualSystemDescriptionEntry*> vsdeUSBController = vsdescThis->findByType(VirtualSystemDescriptionType_USBController);
    14931504        /* If there is no USB controller entry it will be disabled */
    14941505        bool fUSBEnabled = vsdeUSBController.size() > 0;
     
    14961507        {
    14971508            /* Check if the user has disabled the USB controller in the client */
    1498             const Utf8Str& usbVBox = vsdeUSBController.front()->strFinalValue;
     1509            const Utf8Str& usbVBox = vsdeUSBController.front()->strConfig;
    14991510            fUSBEnabled = usbVBox == "1";
    15001511        }
     
    15061517
    15071518        /* Change the network adapters */
    1508         std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsd->findByType(VirtualSystemDescriptionType_NetworkAdapter);
     1519        std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsdescThis->findByType(VirtualSystemDescriptionType_NetworkAdapter);
    15091520        if (vsdeNW.size() == 0)
    15101521        {
     
    15261537                 ++nwIt, ++a)
    15271538            {
    1528                 const Utf8Str &nwTypeVBox = (*nwIt)->strFinalValue;
     1539                const Utf8Str &nwTypeVBox = (*nwIt)->strConfig;
    15291540                uint32_t tt1 = RTStrToUInt32(nwTypeVBox.c_str());
    15301541                ComPtr<INetworkAdapter> nwVBox;
     
    15411552
    15421553        /* Floppy drive */
    1543         std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsd->findByType(VirtualSystemDescriptionType_Floppy);
     1554        std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsdescThis->findByType(VirtualSystemDescriptionType_Floppy);
    15441555        /* If there is no floppy drive entry it will be disabled */
    15451556        bool fFloppyEnabled = vsdeFloppy.size() > 0;
     
    15471558        {
    15481559            /* Check if the user has disabled the floppy drive in the client */
    1549             const Utf8Str& floppyVBox = vsdeFloppy.front()->strFinalValue;
     1560            const Utf8Str& floppyVBox = vsdeFloppy.front()->strConfig;
    15501561            fFloppyEnabled = floppyVBox == "1";
    15511562        }
     
    15611572
    15621573        /* Hard disk controller IDE */
    1563         std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE);
     1574        std::list<VirtualSystemDescriptionEntry*> vsdeHDCIDE = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerIDE);
    15641575        /* @todo: we support one IDE controller only */
    15651576        if (vsdeHDCIDE.size() > 0)
    15661577        {
    1567              IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front()->strFinalValue.c_str()));
     1578             IDEControllerType_T hdcVBox = static_cast<IDEControllerType_T>(RTStrToUInt32(vsdeHDCIDE.front()->strConfig.c_str()));
    15681579             /* Set the appropriate IDE controller in the virtual BIOS of the
    15691580              * VM. */
     
    15761587#ifdef VBOX_WITH_AHCI
    15771588        /* Hard disk controller SATA */
    1578         std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA);
     1589        std::list<VirtualSystemDescriptionEntry*> vsdeHDCSATA = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSATA);
    15791590        /* @todo: we support one SATA controller only */
    15801591        if (vsdeHDCSATA.size() > 0)
    15811592        {
    1582             const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strFinalValue;
     1593            const Utf8Str &hdcVBox = vsdeHDCIDE.front()->strConfig;
    15831594            if (hdcVBox == "AHCI")
    15841595            {
     
    15981609#ifdef VBOX_WITH_SCSI
    15991610        /* Hard disk controller SCSI */
    1600         EntriesList vsdeHDCSCSI = vsd->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI);
     1611        EntriesList vsdeHDCSCSI = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskControllerSCSI);
    16011612        /* @todo: do we support more than one SCSI controller? */
    16021613        if (vsdeHDCSCSI.size() > 0)
     
    16121623
    16131624        /* Create the hard disks & connect them to the appropriate controllers. */
    1614         std::list<VirtualSystemDescriptionEntry*> vsdeHD = vsd->findByType(VirtualSystemDescriptionType_HardDiskImage);
    1615         if (vsdeHD.size() > 0)
     1625        std::list<VirtualSystemDescriptionEntry*> avsdeHDs = vsdescThis->findByType(VirtualSystemDescriptionType_HardDiskImage);
     1626        if (avsdeHDs.size() > 0)
    16161627        {
    16171628            /* That we can attach hard disks we need to open a session for the
     
    16291640            /* The disk image has to be on the same place as the OVF file. So
    16301641             * strip the filename out of the full file path. */
    1631             char *srcDir = RTStrDup(Utf8Str(m->bstrPath).raw());
    1632             RTPathStripFilename(srcDir);
     1642            char *pszSrcDir = RTStrDup(Utf8Str(m->bstrPath).raw());
     1643            RTPathStripFilename(pszSrcDir);
     1644            Utf8Str strSrcDir(pszSrcDir);
     1645            RTStrFree(pszSrcDir);
     1646
    16331647            /* Iterate over all given disk images */
    16341648            list<VirtualSystemDescriptionEntry*>::const_iterator hdIt;
    1635             for (hdIt = vsdeHD.begin();
    1636                  hdIt != vsdeHD.end();
     1649            for (hdIt = avsdeHDs.begin();
     1650                 hdIt != avsdeHDs.end();
    16371651                 ++hdIt)
    16381652            {
    1639                 char *dstFilePath = RTStrDup((*hdIt)->strFinalValue.c_str());
     1653                const VirtualSystemDescriptionEntry &vsdeHD = (**hdIt);
     1654
     1655                const char *pcszDestFilePath = vsdeHD.strConfig.c_str();
    16401656                /* Check if the destination file exists already or the
    16411657                 * destination path is empty. */
    1642                 if (RTPathExists(dstFilePath) ||
    1643                     !RTStrCmp(dstFilePath, ""))
     1658                if (RTPathExists(pcszDestFilePath) ||
     1659                    !RTStrCmp(pcszDestFilePath, ""))
    16441660                {
    16451661                    /* @todo: what now? For now we override in no
     
    16471663                    continue;
    16481664                }
    1649                 const Utf8Str &strRef = (*hdIt)->strRef;
     1665
     1666                uint32_t ulRef = (*hdIt)->ulRef;
    16501667                /* Get the associated disk image */
    1651                 if (m->mapDisks.find(strRef) == m->mapDisks.end() ||
    1652                     vs.mapVirtualDisks.find(strRef) == vs.mapVirtualDisks.end())
     1668                if (m->mapDisks.find(ulRef) == m->mapDisks.end() ||
     1669                    vsysThis.mapVirtualDisks.find(ulRef) == vsysThis.mapVirtualDisks.end())
    16531670                {
    16541671                    /* @todo: error: entry doesn't exists */
    16551672                }
    1656                 DiskImage di = m->mapDisks[strRef];
    1657                 VirtualDisk vd = (*vs.mapVirtualDisks.find(strRef)).second;
     1673                DiskImage di = m->mapDisks[ulRef];
     1674                VirtualDisk vd = (*vsysThis.mapVirtualDisks.find(ulRef)).second;
    16581675                /* Construct the source file path */
    1659                 char *srcFilePath;
    1660                 RTStrAPrintf(&srcFilePath, "%s/%s", srcDir, di.strHref.c_str());
     1676                Utf8StrFmt strSrcFilePath("%s/%s", strSrcDir.c_str(), di.strHref.c_str());
    16611677                /* Check if the source file exists */
    1662                 if (!RTPathExists(srcFilePath))
     1678                if (!RTPathExists(strSrcFilePath.c_str()))
    16631679                {
    16641680                    /* @todo: we have to create a new one */
     
    16671683                {
    16681684                    /* Make sure all target directories exists */
    1669                     rc = VirtualBox::ensureFilePathExists(dstFilePath);
     1685                    rc = VirtualBox::ensureFilePathExists(pcszDestFilePath);
    16701686                    CheckComRCThrowRC(rc);
    16711687                    /* Clone the disk image (this is necessary cause the id has
     
    16741690                    /* First open the existing disk image */
    16751691                    ComPtr<IHardDisk2> srcHdVBox;
    1676                     rc = mVirtualBox->OpenHardDisk2(Bstr(srcFilePath), srcHdVBox.asOutParam());
     1692                    rc = mVirtualBox->OpenHardDisk2(Bstr(strSrcFilePath), srcHdVBox.asOutParam());
    16771693                    CheckComRCReturnRC(rc);
    16781694                    /* We need the format description of the source disk image */
     
    16821698                    /* Create a new hard disk interface for the destination disk image */
    16831699                    ComPtr<IHardDisk2> dstHdVBox;
    1684                     rc = mVirtualBox->CreateHardDisk2(srcFormat, Bstr(dstFilePath), dstHdVBox.asOutParam());
     1700                    rc = mVirtualBox->CreateHardDisk2(srcFormat, Bstr(pcszDestFilePath), dstHdVBox.asOutParam());
    16851701                    CheckComRCReturnRC(rc);
    16861702                    /* Clone the source disk image */
     
    17001716                    CheckComRCReturnRC(rc);
    17011717                    /* For now we assume we have one controller of every type only */
    1702                     HardDiskController hdc = (*vs.mapControllers.find(vd.idController)).second;
     1718                    HardDiskController hdc = (*vsysThis.mapControllers.find(vd.idController)).second;
    17031719                    StorageBus_T sbt = StorageBus_IDE;
    1704                     switch (hdc.controllerSystem)
     1720                    switch (hdc.system)
    17051721                    {
    1706                         case IDE: sbt = StorageBus_IDE; break;
    1707                         case SATA: sbt = StorageBus_SATA; break;
     1722                        case HardDiskController::IDE: sbt = StorageBus_IDE; break;
     1723                        case HardDiskController::SATA: sbt = StorageBus_SATA; break;
    17081724                        //case SCSI: sbt = StorageBus_SCSI; break; // @todo: not available yet
    17091725                        default: break;
     
    17161732                    CheckComRCReturnRC(rc);
    17171733                }
    1718                 RTStrFree(srcFilePath);
    1719                 RTStrFree(dstFilePath);
    17201734            }
    1721             RTStrFree(srcDir);
    17221735        }
    17231736        /* @todo: Unregister on failure */
     
    18121825
    18131826STDMETHODIMP VirtualSystemDescription::GetDescription(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
     1827                                                      ComSafeArrayOut(ULONG, aRefs),
    18141828                                                      ComSafeArrayOut(BSTR, aOrigValues),
    1815                                                       ComSafeArrayOut(BSTR, aAutoValues),
    1816                                                       ComSafeArrayOut(BSTR, aConfigurations))
     1829                                                      ComSafeArrayOut(BSTR, aConfigValues),
     1830                                                      ComSafeArrayOut(BSTR, aExtraConfigValues))
    18171831{
    18181832    if (ComSafeArrayOutIsNull(aTypes) ||
     1833        ComSafeArrayOutIsNull(aRefs) ||
    18191834        ComSafeArrayOutIsNull(aOrigValues) ||
    1820         ComSafeArrayOutIsNull(aAutoValues) ||
    1821         ComSafeArrayOutIsNull(aConfigurations))
     1835        ComSafeArrayOutIsNull(aConfigValues) ||
     1836        ComSafeArrayOutIsNull(aExtraConfigValues))
    18221837        return E_POINTER;
    18231838
     
    18291844    ULONG c = (ULONG)m->descriptions.size();
    18301845    com::SafeArray<VirtualSystemDescriptionType_T> sfaTypes(c);
     1846    com::SafeArray<ULONG> sfaRefs(c);
    18311847    com::SafeArray<BSTR> sfaOrigValues(c);
    1832     com::SafeArray<BSTR> sfaAutoValues(c);
    1833     com::SafeArray<BSTR> sfaConfigurations(c);
     1848    com::SafeArray<BSTR> sfaConfigValues(c);
     1849    com::SafeArray<BSTR> sfaExtraConfigValues(c);
    18341850
    18351851    list<VirtualSystemDescriptionEntry>::const_iterator it;
     
    18401856    {
    18411857        const VirtualSystemDescriptionEntry &vsde = (*it);
    1842         /* Types */
    1843         sfaTypes [i] = vsde.type;
    1844         /* Original value */
    1845         Bstr bstr = vsde.strOriginalValue;
     1858
     1859        sfaTypes[i] = vsde.type;
     1860
     1861        sfaRefs[i] = vsde.ulRef;
     1862
     1863        Bstr bstr = vsde.strOrig;
    18461864        bstr.cloneTo(&sfaOrigValues[i]);
    1847         /* Auto value */
    1848         bstr = vsde.strAutoValue;
    1849         bstr.cloneTo(&sfaAutoValues[i]);
    1850         /* Configuration */
    1851         bstr = vsde.strConfiguration;
    1852         bstr.cloneTo(&sfaConfigurations[i]);
     1865
     1866        bstr = vsde.strConfig;
     1867        bstr.cloneTo(&sfaConfigValues[i]);
     1868
     1869        bstr = vsde.strExtraConfig;
     1870        bstr.cloneTo(&sfaExtraConfigValues[i]);
    18531871    }
    18541872
    18551873    sfaTypes.detachTo(ComSafeArrayOutArg(aTypes));
     1874    sfaRefs.detachTo(ComSafeArrayOutArg(aRefs));
    18561875    sfaOrigValues.detachTo(ComSafeArrayOutArg(aOrigValues));
    1857     sfaAutoValues.detachTo(ComSafeArrayOutArg(aAutoValues));
    1858     sfaConfigurations.detachTo(ComSafeArrayOutArg(aConfigurations));
     1876    sfaConfigValues.detachTo(ComSafeArrayOutArg(aConfigValues));
     1877    sfaExtraConfigValues.detachTo(ComSafeArrayOutArg(aExtraConfigValues));
    18591878
    18601879    return S_OK;
     
    18811900    {
    18821901        VirtualSystemDescriptionEntry vsde = (*it);
    1883         vsde.strFinalValue = values[i];
     1902        vsde.strConfig = values[i];
    18841903    }
    18851904
     
    18881907
    18891908void VirtualSystemDescription::addEntry(VirtualSystemDescriptionType_T aType,
    1890                                         const Utf8Str &aRef,
     1909                                        uint32_t ulRef,
    18911910                                        const Utf8Str &aOrigValue,
    1892                                         const Utf8Str &aAutoValue,
    1893                                         const Utf8Str &aConfig /* = "" */)
     1911                                        const Utf8Str &aAutoValue)
    18941912{
    18951913    VirtualSystemDescriptionEntry vsde;
    18961914    vsde.type = aType;
    1897     vsde.strRef = aRef;
    1898     vsde.strOriginalValue = aOrigValue;
    1899     vsde.strAutoValue = aAutoValue;
    1900     vsde.strConfiguration = aConfig;
    1901     /* For now we add the auto value as final value also */
    1902     vsde.strFinalValue = aAutoValue;
     1915    vsde.ulRef = ulRef;
     1916    vsde.strOrig = aOrigValue;
     1917    vsde.strConfig = aAutoValue;
    19031918
    19041919    m->descriptions.push_back(vsde);
  • trunk/src/VBox/Main/glue/string.cpp

    r16384 r16495  
    7979}
    8080
     81int Utf8Str::toInt(uint64_t &i) const
     82{
     83    return RTStrToUInt64Ex(str, NULL, 0, &i);
     84}
     85
     86int Utf8Str::toInt(uint32_t &i) const
     87{
     88    return RTStrToUInt32Ex(str, NULL, 0, &i);
     89}
     90
    8191struct FormatData
    8292{
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r16492 r16495  
    29902990    a configuration value.</desc>
    29912991
    2992     <const name="Name" value="1" />
    2993     <const name="OS" value="2" />
    2994     <const name="CPU" value="3" />
    2995     <const name="Memory" value="4" />
    2996     <const name="HardDiskControllerIDE" value="5" />
    2997     <const name="HardDiskControllerSATA" value="6" />
    2998     <const name="HardDiskControllerSCSI" value="7" />
    2999     <const name="HardDiskImage" value="8" />
    3000     <const name="CDROM" value="9" />
    3001     <const name="Floppy" value="10" />
    3002     <const name="NetworkAdapter" value="11" />
    3003     <const name="USBController" value="12" />
    3004     <const name="SoundCard" value="13" />
     2992    <const name="Ignore" value="1" />
     2993    <const name="Name" value="2" />
     2994    <const name="OS" value="3" />
     2995    <const name="CPU" value="4" />
     2996    <const name="Memory" value="5" />
     2997    <const name="HardDiskControllerIDE" value="6" />
     2998    <const name="HardDiskControllerSATA" value="7" />
     2999    <const name="HardDiskControllerSCSI" value="8" />
     3000    <const name="HardDiskImage" value="9" />
     3001    <const name="CDROM" value="10" />
     3002    <const name="Floppy" value="11" />
     3003    <const name="NetworkAdapter" value="12" />
     3004    <const name="USBController" value="13" />
     3005    <const name="SoundCard" value="14" />
    30053006
    30063007  </enum>
     
    30253026      The list below identifies the value sets that are possible depending on the
    30263027      <link to="VirtualSystemDescriptionType" /> enum value in the array item in aTypes[]. In each case,
    3027       the array item with the same index in aOrigValues[] will contain the original value as contained
    3028       in the OVF file, and the corresponding item in aAutoValues[] will contain a suggested value to
    3029       be used for VirtualBox. Items in the other arrays will be empty, unless specified otherwise below:
     3028      the array item with the same index in aOrigValue[] will contain the original value as contained
     3029      in the OVF file (just for informational purposes), and the corresponding item in aConfigValues[]
     3030      will contain a suggested value to be used for VirtualBox. Depending on the description type,
     3031      the aExtraConfigValues[] array item may also be used.
    30303032
    30313033      <ul>
    30323034      <li>
    3033         "OS": then the corresponding item in aAutoValues[] contains the suggested guest operating system
    3034         for VirtualBox. The corresponding item in aOrigValues[] will contain a numerical value that
    3035         described the operating system in the OVF (see <link to="CIMOSType" />).
     3035        "OS": the guest operating system type. There must be exactly one such array item on import. The
     3036        corresponding item in aConfigValues[] contains the suggested guest operating system for VirtualBox.
     3037        This will be one of the values listed in <link to="IVirtualBox::guestOSTypes" />. The corresponding
     3038        item in aOrigValues[] will contain a numerical value that described the operating system in the OVF
     3039        (see <link to="CIMOSType" />).
    30363040      </li>
    30373041      <li>
    3038         "Name": then the correponding item im aOrigValues[] will contain the suggested virtual machine name
    3039         from the OVF file, and aAutoValues[] will contain a suggestion for a unique VirtualBox
     3042        "Name": the name to give to the new virtual machine. There can be at most one such array item;
     3043        if none is present on import, then an automatic name will be created from the operating system
     3044        type. The correponding item im aOrigValues[] will contain the suggested virtual machine name
     3045        from the OVF file, and aConfigValues[] will contain a suggestion for a unique VirtualBox
    30403046        <link to="IMachine" /> name that does not exist yet.
    30413047      </li>
    30423048      <li>
    3043         "CPU": number of CPUs.
     3049        "CPU": the number of CPUs. There can be at most one such item, which will presently be ignored.
    30443050      </li>
    30453051      <li>
    3046         "Memory": amount of memory, in bytes.
     3052        "Memory": the amount of guest RAM, in bytes. There can be at most one such array item; if none
     3053        is present on import, then VirtualBox will set a meaningful default based on the operating system
     3054        type.
    30473055      </li>
    30483056      <li>
    3049         "HarddiskControllerSCSI": a SCSI hard disk controller. Here the items in aOrigValues[] and aAutoValues[] will either be
    3050         "LsiLogic" or "BusLogic". The matching item in the aRefValue[] array will contain a numerical
    3051         index that other items of the "Harddisk" type can use to specify which hard disk controller
    3052         a virtual disk should be connected to.
     3057        "HarddiskControllerSCSI": a SCSI hard disk controller. There can be at most one such item.
     3058        The items in aOrigValues[] and aConfigValues[] will either be "LsiLogic" or "BusLogic". The
     3059        matching item in the aRefs[] array will contain an integer that other items of the "Harddisk"
     3060        type can use to specify which hard disk controller a virtual disk should be connected to.
    30533061      </li>
    30543062      <li>
    3055         "HarddiskControllerIDE": an IDE hard disk controller. This has no value in aOrigValues[] or aAutoValues[];
    3056         as with SCSI controllers, the matching item in the aRefValues[] array will contain a numerical
    3057         index that other items of the "Harddisk" type can use to specify which hard disk controller
    3058         a virtual disk should be connected to.
     3063        "HarddiskControllerIDE": an IDE hard disk controller. There can be at most one such item. This
     3064        has no value in aOrigValues[] or aAutoValues[]. The matching item in the aRefs[] array will be
     3065        used as with SCSI controllers (see above).
    30593066      </li>
    30603067      <li>
    3061         "Harddisk": a virtual hard disk, most probably as a reference to an image file. The array item
    3062         in aOrigValues[] will contain the file specification from the OVF file, whereas the item
    3063         in aAutoValues[] will contain the fully qualified path to the image, which VirtualBox has verified
    3064         to exist.
    3065         The item in the aRefValues[] array specifies the hard disk controller to connect to and has the
    3066         same value as another aRefValues[] array item of the types listed above.
     3068        "Harddisk": a virtual hard disk, most probably as a reference to an image file. There can be an
     3069        arbitrary number of these items, one for each virtual disk image that accompanies the OVF. The
     3070        array item in aOrigValues[] will contain the file specification from the OVF file, whereas the item
     3071        in aConfigValues[] will contain a qualified path specification where the hard disk image should
     3072        be copied to; this target image will then be registered with VirtualBox.
     3073        The matching item in the aRefs[] array must contain a integer specifying the hard disk controller
     3074        to connect the image to. This number must be the same as the integer used by one of the hard disk
     3075        controller items (SCSI, SATA or IDE; see above).
    30673076      </li>
    30683077      <li>
    30693078        "NetworkAdapter": a network adapter. (todo document)
    30703079      </li>
     3080      <li>
     3081        "SoundCard": a sound card. There can be at most one such item. If and only if such an item is
     3082        present, sound support will be enabled for the new virtual machine. Note that the virtual
     3083        machine in VirtualBox will always be presented with the standard VirtualBox soundcard, which
     3084        may be different from the virtual soundcard expected by the appliance.
     3085      </li>
    30713086      </ul>
    30723087
     
    30773092      </param>
    30783093
     3094      <param name="aRefs" type="unsigned long" dir="out" safearray="yes">
     3095        <desc></desc>
     3096      </param>
     3097
    30793098      <param name="aOrigValues" type="wstring" dir="out" safearray="yes">
    30803099        <desc></desc>
    30813100      </param>
    30823101
    3083       <param name="aAutoValues" type="wstring" dir="out" safearray="yes">
     3102      <param name="aConfigValues" type="wstring" dir="out" safearray="yes">
    30843103        <desc></desc>
    30853104      </param>
    30863105
    3087       <param name="aConfiguration" type="wstring" dir="out" safearray="yes">
     3106      <param name="aExtraConfigValues" type="wstring" dir="out" safearray="yes">
    30883107        <desc></desc>
    30893108      </param>
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r16325 r16495  
    9797{
    9898    VirtualSystemDescriptionType_T type; /* Of which type is this value */
    99     Utf8Str strRef; /* Reference value to the internal implementation */
    100     Utf8Str strOriginalValue; /* The original OVF value */
    101     Utf8Str strAutoValue; /* The value which VBox suggest */
    102     Utf8Str strFinalValue; /* The value the user select */
    103     Utf8Str strConfiguration; /* Additional configuration data for this type */
     99    uint32_t ulRef;     // reference number
     100    Utf8Str strOrig; /* The original OVF value */
     101    Utf8Str strConfig; /* The value which VBox suggest */
     102    Utf8Str strExtraConfig; /* Additional configuration data for this type */
    104103};
    105104
     
    141140    /* IVirtualSystemDescription methods */
    142141    STDMETHOD(GetDescription)(ComSafeArrayOut(VirtualSystemDescriptionType_T, aTypes),
     142                              ComSafeArrayOut(ULONG, aRefs),
    143143                              ComSafeArrayOut(BSTR, aOrigValues),
    144                               ComSafeArrayOut(BSTR, aAutoValues),
    145                               ComSafeArrayOut(BSTR, aConfigurations));
     144                              ComSafeArrayOut(BSTR, aConfigValues),
     145                              ComSafeArrayOut(BSTR, aExtraConfigValues));
    146146    STDMETHOD(SetFinalValues)(ComSafeArrayIn(IN_BSTR, aFinalValues));
    147147
     
    151151private:
    152152    void addEntry(VirtualSystemDescriptionType_T aType,
    153                   const Utf8Str &aRef,
     153                  uint32_t ulRef,
    154154                  const Utf8Str &aOrigValue,
    155                   const Utf8Str &aAutoValue,
    156                   const Utf8Str &aConfig = "");
     155                  const Utf8Str &aAutoValue);
    157156
    158157    std::list<VirtualSystemDescriptionEntry*> findByType(VirtualSystemDescriptionType_T aType);
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