Changeset 27908 in vbox
- Timestamp:
- Mar 31, 2010 2:32:46 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r27900 r27908 47 47 static const struct 48 48 { 49 CIMOSType_Tcim;50 const char *pcszVbox;49 ovf::CIMOSType_T cim; 50 const char *pcszVbox; 51 51 } 52 52 g_osTypes[] = 53 53 { 54 { CIMOSType_CIMOS_Unknown, SchemaDefs_OSTypeId_Other },55 { CIMOSType_CIMOS_OS2, SchemaDefs_OSTypeId_OS2 },56 { CIMOSType_CIMOS_MSDOS, SchemaDefs_OSTypeId_DOS },57 { CIMOSType_CIMOS_WIN3x, SchemaDefs_OSTypeId_Windows31 },58 { CIMOSType_CIMOS_WIN95, SchemaDefs_OSTypeId_Windows95 },59 { CIMOSType_CIMOS_WIN98, SchemaDefs_OSTypeId_Windows98 },60 { CIMOSType_CIMOS_WINNT, SchemaDefs_OSTypeId_WindowsNT4 },61 { CIMOSType_CIMOS_NetWare, SchemaDefs_OSTypeId_Netware },62 { CIMOSType_CIMOS_NovellOES, SchemaDefs_OSTypeId_Netware },63 { CIMOSType_CIMOS_Solaris, SchemaDefs_OSTypeId_OpenSolaris },64 { CIMOSType_CIMOS_SunOS, SchemaDefs_OSTypeId_OpenSolaris },65 { CIMOSType_CIMOS_FreeBSD, SchemaDefs_OSTypeId_FreeBSD },66 { CIMOSType_CIMOS_NetBSD, SchemaDefs_OSTypeId_NetBSD },67 { CIMOSType_CIMOS_QNX, SchemaDefs_OSTypeId_QNX },68 { CIMOSType_CIMOS_Windows2000, SchemaDefs_OSTypeId_Windows2000 },69 { CIMOSType_CIMOS_WindowsMe, SchemaDefs_OSTypeId_WindowsMe },70 { CIMOSType_CIMOS_OpenBSD, SchemaDefs_OSTypeId_OpenBSD },71 { CIMOSType_CIMOS_WindowsXP, SchemaDefs_OSTypeId_WindowsXP },72 { CIMOSType_CIMOS_WindowsXPEmbedded, SchemaDefs_OSTypeId_WindowsXP },73 { CIMOSType_CIMOS_WindowsEmbeddedforPointofService, SchemaDefs_OSTypeId_WindowsXP },74 { CIMOSType_CIMOS_MicrosoftWindowsServer2003, SchemaDefs_OSTypeId_Windows2003 },75 { CIMOSType_CIMOS_MicrosoftWindowsServer2003_64, SchemaDefs_OSTypeId_Windows2003_64 },76 { CIMOSType_CIMOS_WindowsXP_64, SchemaDefs_OSTypeId_WindowsXP_64 },77 { CIMOSType_CIMOS_WindowsVista, SchemaDefs_OSTypeId_WindowsVista },78 { CIMOSType_CIMOS_WindowsVista_64, SchemaDefs_OSTypeId_WindowsVista_64 },79 { CIMOSType_CIMOS_MicrosoftWindowsServer2008, SchemaDefs_OSTypeId_Windows2008 },80 { CIMOSType_CIMOS_MicrosoftWindowsServer2008_64, SchemaDefs_OSTypeId_Windows2008_64 },81 { CIMOSType_CIMOS_FreeBSD_64, SchemaDefs_OSTypeId_FreeBSD_64 },82 { CIMOSType_CIMOS_RedHatEnterpriseLinux, SchemaDefs_OSTypeId_RedHat },83 { CIMOSType_CIMOS_RedHatEnterpriseLinux_64, SchemaDefs_OSTypeId_RedHat_64 },84 { CIMOSType_CIMOS_Solaris_64, SchemaDefs_OSTypeId_OpenSolaris_64 },85 { CIMOSType_CIMOS_SUSE, SchemaDefs_OSTypeId_OpenSUSE },86 { CIMOSType_CIMOS_SLES, SchemaDefs_OSTypeId_OpenSUSE },87 { CIMOSType_CIMOS_NovellLinuxDesktop, SchemaDefs_OSTypeId_OpenSUSE },88 { CIMOSType_CIMOS_SUSE_64, SchemaDefs_OSTypeId_OpenSUSE_64 },89 { CIMOSType_CIMOS_SLES_64, SchemaDefs_OSTypeId_OpenSUSE_64 },90 { CIMOSType_CIMOS_LINUX, SchemaDefs_OSTypeId_Linux },91 { CIMOSType_CIMOS_SunJavaDesktopSystem, SchemaDefs_OSTypeId_Linux },92 { CIMOSType_CIMOS_TurboLinux, SchemaDefs_OSTypeId_Linux},93 94 // { CIMOSType_CIMOS_TurboLinux_64, },95 96 { CIMOSType_CIMOS_Mandriva, SchemaDefs_OSTypeId_Mandriva },97 { CIMOSType_CIMOS_Mandriva_64, SchemaDefs_OSTypeId_Mandriva_64 },98 { CIMOSType_CIMOS_Ubuntu, SchemaDefs_OSTypeId_Ubuntu },99 { CIMOSType_CIMOS_Ubuntu_64, SchemaDefs_OSTypeId_Ubuntu_64 },100 { CIMOSType_CIMOS_Debian, SchemaDefs_OSTypeId_Debian },101 { CIMOSType_CIMOS_Debian_64, SchemaDefs_OSTypeId_Debian_64 },102 { CIMOSType_CIMOS_Linux_2_4_x, SchemaDefs_OSTypeId_Linux24 },103 { CIMOSType_CIMOS_Linux_2_4_x_64, SchemaDefs_OSTypeId_Linux24_64 },104 { CIMOSType_CIMOS_Linux_2_6_x, SchemaDefs_OSTypeId_Linux26 },105 { CIMOSType_CIMOS_Linux_2_6_x_64, SchemaDefs_OSTypeId_Linux26_64 },106 { CIMOSType_CIMOS_Linux_64, SchemaDefs_OSTypeId_Linux26_64 }54 { ovf::CIMOSType_CIMOS_Unknown, SchemaDefs_OSTypeId_Other }, 55 { ovf::CIMOSType_CIMOS_OS2, SchemaDefs_OSTypeId_OS2 }, 56 { ovf::CIMOSType_CIMOS_MSDOS, SchemaDefs_OSTypeId_DOS }, 57 { ovf::CIMOSType_CIMOS_WIN3x, SchemaDefs_OSTypeId_Windows31 }, 58 { ovf::CIMOSType_CIMOS_WIN95, SchemaDefs_OSTypeId_Windows95 }, 59 { ovf::CIMOSType_CIMOS_WIN98, SchemaDefs_OSTypeId_Windows98 }, 60 { ovf::CIMOSType_CIMOS_WINNT, SchemaDefs_OSTypeId_WindowsNT4 }, 61 { ovf::CIMOSType_CIMOS_NetWare, SchemaDefs_OSTypeId_Netware }, 62 { ovf::CIMOSType_CIMOS_NovellOES, SchemaDefs_OSTypeId_Netware }, 63 { ovf::CIMOSType_CIMOS_Solaris, SchemaDefs_OSTypeId_OpenSolaris }, 64 { ovf::CIMOSType_CIMOS_SunOS, SchemaDefs_OSTypeId_OpenSolaris }, 65 { ovf::CIMOSType_CIMOS_FreeBSD, SchemaDefs_OSTypeId_FreeBSD }, 66 { ovf::CIMOSType_CIMOS_NetBSD, SchemaDefs_OSTypeId_NetBSD }, 67 { ovf::CIMOSType_CIMOS_QNX, SchemaDefs_OSTypeId_QNX }, 68 { ovf::CIMOSType_CIMOS_Windows2000, SchemaDefs_OSTypeId_Windows2000 }, 69 { ovf::CIMOSType_CIMOS_WindowsMe, SchemaDefs_OSTypeId_WindowsMe }, 70 { ovf::CIMOSType_CIMOS_OpenBSD, SchemaDefs_OSTypeId_OpenBSD }, 71 { ovf::CIMOSType_CIMOS_WindowsXP, SchemaDefs_OSTypeId_WindowsXP }, 72 { ovf::CIMOSType_CIMOS_WindowsXPEmbedded, SchemaDefs_OSTypeId_WindowsXP }, 73 { ovf::CIMOSType_CIMOS_WindowsEmbeddedforPointofService, SchemaDefs_OSTypeId_WindowsXP }, 74 { ovf::CIMOSType_CIMOS_MicrosoftWindowsServer2003, SchemaDefs_OSTypeId_Windows2003 }, 75 { ovf::CIMOSType_CIMOS_MicrosoftWindowsServer2003_64, SchemaDefs_OSTypeId_Windows2003_64 }, 76 { ovf::CIMOSType_CIMOS_WindowsXP_64, SchemaDefs_OSTypeId_WindowsXP_64 }, 77 { ovf::CIMOSType_CIMOS_WindowsVista, SchemaDefs_OSTypeId_WindowsVista }, 78 { ovf::CIMOSType_CIMOS_WindowsVista_64, SchemaDefs_OSTypeId_WindowsVista_64 }, 79 { ovf::CIMOSType_CIMOS_MicrosoftWindowsServer2008, SchemaDefs_OSTypeId_Windows2008 }, 80 { ovf::CIMOSType_CIMOS_MicrosoftWindowsServer2008_64, SchemaDefs_OSTypeId_Windows2008_64 }, 81 { ovf::CIMOSType_CIMOS_FreeBSD_64, SchemaDefs_OSTypeId_FreeBSD_64 }, 82 { ovf::CIMOSType_CIMOS_RedHatEnterpriseLinux, SchemaDefs_OSTypeId_RedHat }, 83 { ovf::CIMOSType_CIMOS_RedHatEnterpriseLinux_64, SchemaDefs_OSTypeId_RedHat_64 }, 84 { ovf::CIMOSType_CIMOS_Solaris_64, SchemaDefs_OSTypeId_OpenSolaris_64 }, 85 { ovf::CIMOSType_CIMOS_SUSE, SchemaDefs_OSTypeId_OpenSUSE }, 86 { ovf::CIMOSType_CIMOS_SLES, SchemaDefs_OSTypeId_OpenSUSE }, 87 { ovf::CIMOSType_CIMOS_NovellLinuxDesktop, SchemaDefs_OSTypeId_OpenSUSE }, 88 { ovf::CIMOSType_CIMOS_SUSE_64, SchemaDefs_OSTypeId_OpenSUSE_64 }, 89 { ovf::CIMOSType_CIMOS_SLES_64, SchemaDefs_OSTypeId_OpenSUSE_64 }, 90 { ovf::CIMOSType_CIMOS_LINUX, SchemaDefs_OSTypeId_Linux }, 91 { ovf::CIMOSType_CIMOS_SunJavaDesktopSystem, SchemaDefs_OSTypeId_Linux }, 92 { ovf::CIMOSType_CIMOS_TurboLinux, SchemaDefs_OSTypeId_Linux}, 93 94 // { ovf::CIMOSType_CIMOS_TurboLinux_64, }, 95 96 { ovf::CIMOSType_CIMOS_Mandriva, SchemaDefs_OSTypeId_Mandriva }, 97 { ovf::CIMOSType_CIMOS_Mandriva_64, SchemaDefs_OSTypeId_Mandriva_64 }, 98 { ovf::CIMOSType_CIMOS_Ubuntu, SchemaDefs_OSTypeId_Ubuntu }, 99 { ovf::CIMOSType_CIMOS_Ubuntu_64, SchemaDefs_OSTypeId_Ubuntu_64 }, 100 { ovf::CIMOSType_CIMOS_Debian, SchemaDefs_OSTypeId_Debian }, 101 { ovf::CIMOSType_CIMOS_Debian_64, SchemaDefs_OSTypeId_Debian_64 }, 102 { ovf::CIMOSType_CIMOS_Linux_2_4_x, SchemaDefs_OSTypeId_Linux24 }, 103 { ovf::CIMOSType_CIMOS_Linux_2_4_x_64, SchemaDefs_OSTypeId_Linux24_64 }, 104 { ovf::CIMOSType_CIMOS_Linux_2_6_x, SchemaDefs_OSTypeId_Linux26 }, 105 { ovf::CIMOSType_CIMOS_Linux_2_6_x_64, SchemaDefs_OSTypeId_Linux26_64 }, 106 { ovf::CIMOSType_CIMOS_Linux_64, SchemaDefs_OSTypeId_Linux26_64 } 107 107 }; 108 108 … … 173 173 * @param cStr 174 174 */ 175 void convertCIMOSType2VBoxOSType(Utf8Str &strType, CIMOSType_T c, const Utf8Str &cStr)175 void convertCIMOSType2VBoxOSType(Utf8Str &strType, ovf::CIMOSType_T c, const Utf8Str &cStr) 176 176 { 177 177 /* First check if the type is other/other_64 */ 178 if (c == CIMOSType_CIMOS_Other)178 if (c == ovf::CIMOSType_CIMOS_Other) 179 179 { 180 180 for (size_t i=0; i < RT_ELEMENTS(g_osTypesPattern); ++i) … … 185 185 } 186 186 } 187 else if (c == CIMOSType_CIMOS_Other_64)187 else if (c == ovf::CIMOSType_CIMOS_Other_64) 188 188 { 189 189 for (size_t i=0; i < RT_ELEMENTS(g_osTypesPattern64); ++i) … … 213 213 * @param c 214 214 */ 215 CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVbox)215 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVbox) 216 216 { 217 217 for (size_t i = 0; i < RT_ELEMENTS(g_osTypes); ++i) … … 221 221 } 222 222 223 return CIMOSType_CIMOS_Other;223 return ovf::CIMOSType_CIMOS_Other; 224 224 } 225 225 … … 358 358 com::SafeArray<BSTR> sfaDisks(c); 359 359 360 DiskImagesMap::const_iterator it;360 ovf::DiskImagesMap::const_iterator it; 361 361 size_t i = 0; 362 362 for (it = m->pReader->m_mapDisks.begin(); … … 365 365 { 366 366 // create a string representing this disk 367 const DiskImage &d = it->second;367 const ovf::DiskImage &d = it->second; 368 368 char *psz = NULL; 369 369 RTStrAPrintf(&psz, -
trunk/src/VBox/Main/ApplianceImplExport.cpp
r27905 r27908 131 131 /* Guest OS type */ 132 132 Utf8Str strOsTypeVBox(bstrGuestOSType); 133 CIMOSType_T cim = convertVBoxOSType2CIMOSType(strOsTypeVBox.c_str());133 ovf::CIMOSType_T cim = convertVBoxOSType2CIMOSType(strOsTypeVBox.c_str()); 134 134 pNewDesc->addEntry(VirtualSystemDescriptionType_OS, 135 135 "", … … 776 776 pelmOperatingSystemSection->createChild("Info")->addContent("The kind of installed guest operating system"); 777 777 Utf8Str strOSDesc; 778 convertCIMOSType2VBoxOSType(strOSDesc, ( CIMOSType_T)llOS.front()->strOvf.toInt32(), "");778 convertCIMOSType2VBoxOSType(strOSDesc, (ovf::CIMOSType_T)llOS.front()->strOvf.toInt32(), ""); 779 779 pelmOperatingSystemSection->createChild("Description")->addContent(strOSDesc); 780 780 … … 843 843 const VirtualSystemDescriptionEntry &desc = *itD; 844 844 845 OVFResourceType_T type = (OVFResourceType_T)0; // if this becomes != 0 then we do stuff845 ovf::ResourceType_T type = (ovf::ResourceType_T)0; // if this becomes != 0 then we do stuff 846 846 Utf8Str strResourceSubType; 847 847 … … 878 878 { 879 879 strDescription = "Number of virtual CPUs"; 880 type = OVFResourceType_Processor; // 3880 type = ovf::ResourceType_Processor; // 3 881 881 desc.strVbox.toInt(uTemp); 882 882 lVirtualQuantity = (int32_t)uTemp; … … 898 898 { 899 899 strDescription = "Memory Size"; 900 type = OVFResourceType_Memory; // 4900 type = ovf::ResourceType_Memory; // 4 901 901 desc.strVbox.toInt(uTemp); 902 902 lVirtualQuantity = (int32_t)(uTemp / _1M); … … 919 919 strDescription = "IDE Controller"; 920 920 strCaption = "ideController0"; 921 type = OVFResourceType_IDEController; // 5921 type = ovf::ResourceType_IDEController; // 5 922 922 strResourceSubType = desc.strVbox; 923 923 // it seems that OVFTool always writes these two, and since we can only … … 947 947 strDescription = "SATA Controller"; 948 948 strCaption = "sataController0"; 949 type = OVFResourceType_OtherStorageDevice; // 20949 type = ovf::ResourceType_OtherStorageDevice; // 20 950 950 // it seems that OVFTool always writes these two, and since we can only 951 951 // have one SATA controller, we'll use this as well … … 982 982 strDescription = "SCSI Controller"; 983 983 strCaption = "scsiController0"; 984 type = OVFResourceType_ParallelSCSIHBA; // 6984 type = ovf::ResourceType_ParallelSCSIHBA; // 6 985 985 // it seems that OVFTool always writes these two, and since we can only 986 986 // have one SATA controller, we'll use this as well … … 1020 1020 strDescription = "Disk Image"; 1021 1021 strCaption = Utf8StrFmt("disk%RI32", cDisks); // this is not used for anything else 1022 type = OVFResourceType_HardDisk; // 171022 type = ovf::ResourceType_HardDisk; // 17 1023 1023 1024 1024 // the following references the "<Disks>" XML block … … 1057 1057 strDescription = "Floppy Drive"; 1058 1058 strCaption = "floppy0"; // this is what OVFTool writes 1059 type = OVFResourceType_FloppyDrive; // 141059 type = ovf::ResourceType_FloppyDrive; // 14 1060 1060 lAutomaticAllocation = 0; 1061 1061 lAddressOnParent = 0; // this is what OVFTool writes … … 1073 1073 strDescription = "CD-ROM Drive"; 1074 1074 strCaption = "cdrom1"; // this is what OVFTool writes 1075 type = OVFResourceType_CDDrive; // 151075 type = ovf::ResourceType_CDDrive; // 15 1076 1076 lAutomaticAllocation = 1; 1077 1077 ulParent = idIDEController; … … 1093 1093 lAutomaticAllocation = 1; 1094 1094 strCaption = Utf8StrFmt("Ethernet adapter on '%s'", desc.strOvf.c_str()); 1095 type = OVFResourceType_EthernetAdapter; // 101095 type = ovf::ResourceType_EthernetAdapter; // 10 1096 1096 /* Set the hardware type to something useful. 1097 1097 * To be compatible with vmware & others we set … … 1127 1127 strDescription = "USB Controller"; 1128 1128 strCaption = "usb"; 1129 type = OVFResourceType_USBController; // 231129 type = ovf::ResourceType_USBController; // 23 1130 1130 lAddress = 0; // this is what OVFTool writes 1131 1131 lBusNumber = 0; // this is what OVFTool writes … … 1147 1147 strDescription = "Sound Card"; 1148 1148 strCaption = "sound"; 1149 type = OVFResourceType_SoundCard; // 351149 type = ovf::ResourceType_SoundCard; // 35 1150 1150 strResourceSubType = desc.strOvf; // e.g. ensoniq1371 1151 1151 lAutomaticAllocation = 0; -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r27905 r27908 144 144 try 145 145 { 146 list< VirtualSystem>::const_iterator it;146 list<ovf::VirtualSystem>::const_iterator it; 147 147 /* Iterate through all virtual systems */ 148 148 for (it = m->pReader->m_llVirtualSystems.begin(); … … 150 150 ++it) 151 151 { 152 const VirtualSystem &vsysThis = *it;152 const ovf::VirtualSystem &vsysThis = *it; 153 153 154 154 ComObjPtr<VirtualSystemDescription> pNewDesc; … … 304 304 if (FAILED(rc)) throw rc; 305 305 306 EthernetAdaptersList::const_iterator itEA;306 ovf::EthernetAdaptersList::const_iterator itEA; 307 307 /* Iterate through all abstract networks. We support 8 network 308 308 * adapters at the maximum, so the first 8 will be added only. */ … … 312 312 ++itEA, ++a) 313 313 { 314 const EthernetAdapter &ea = *itEA; // logical network to connect to314 const ovf::EthernetAdapter &ea = *itEA; // logical network to connect to 315 315 Utf8Str strNetwork = ea.strNetworkName; 316 316 // make sure it's one of these two … … 379 379 uint16_t cSATAused = 0; NOREF(cSATAused); 380 380 uint16_t cSCSIused = 0; NOREF(cSCSIused); 381 ControllersMap::const_iterator hdcIt;381 ovf::ControllersMap::const_iterator hdcIt; 382 382 /* Iterate through all hard disk controllers */ 383 383 for (hdcIt = vsysThis.mapControllers.begin(); … … 385 385 ++hdcIt) 386 386 { 387 const HardDiskController &hdc = hdcIt->second;387 const ovf::HardDiskController &hdc = hdcIt->second; 388 388 Utf8Str strControllerID = Utf8StrFmt("%RI32", (uint32_t)hdc.idController); 389 389 390 390 switch (hdc.system) 391 391 { 392 case HardDiskController::IDE:392 case ovf::HardDiskController::IDE: 393 393 { 394 394 /* Check for the constrains */ … … 421 421 } 422 422 423 case HardDiskController::SATA:423 case ovf::HardDiskController::SATA: 424 424 { 425 425 #ifdef VBOX_WITH_AHCI … … 450 450 } 451 451 452 case HardDiskController::SCSI:452 case ovf::HardDiskController::SCSI: 453 453 { 454 454 #ifdef VBOX_WITH_LSILOGIC … … 482 482 if (vsysThis.mapVirtualDisks.size() > 0) 483 483 { 484 VirtualDisksMap::const_iterator itVD;484 ovf::VirtualDisksMap::const_iterator itVD; 485 485 /* Iterate through all hard disks ()*/ 486 486 for (itVD = vsysThis.mapVirtualDisks.begin(); … … 488 488 ++itVD) 489 489 { 490 const VirtualDisk &hd = itVD->second;490 const ovf::VirtualDisk &hd = itVD->second; 491 491 /* Get the associated disk image */ 492 const DiskImage &di = m->pReader->m_mapDisks[hd.strDiskId];492 const ovf::DiskImage &di = m->pReader->m_mapDisks[hd.strDiskId]; 493 493 494 494 // @todo: … … 684 684 { 685 685 /* Read & parse the XML structure of the OVF file */ 686 m->pReader = new OVFReader(locInfo.strPath);686 m->pReader = new ovf::OVFReader(locInfo.strPath); 687 687 /* Create the SHA1 sum of the OVF file for later validation */ 688 688 char *pszDigest; … … 846 846 * @param mhda 847 847 */ 848 void Appliance::convertDiskAttachmentValues(const HardDiskController &hdc,848 void Appliance::convertDiskAttachmentValues(const ovf::HardDiskController &hdc, 849 849 uint32_t ulAddressOnParent, 850 850 Bstr &controllerType, … … 854 854 switch (hdc.system) 855 855 { 856 case HardDiskController::IDE:856 case ovf::HardDiskController::IDE: 857 857 // For the IDE bus, the channel parameter can be either 0 or 1, to specify the primary 858 858 // or secondary IDE controller, respectively. For the primary controller of the IDE bus, … … 890 890 break; 891 891 892 case HardDiskController::SATA:892 case ovf::HardDiskController::SATA: 893 893 controllerType = Bstr("SATA Controller"); 894 894 lChannel = (long)ulAddressOnParent; … … 896 896 break; 897 897 898 case HardDiskController::SCSI:898 case ovf::HardDiskController::SCSI: 899 899 controllerType = Bstr("SCSI Controller"); 900 900 lChannel = (long)ulAddressOnParent; … … 988 988 if (FAILED(rc)) return rc; 989 989 990 const OVFReader &reader = *m->pReader;990 const ovf::OVFReader &reader = *m->pReader; 991 991 // this is safe to access because this thread only gets started 992 992 // if pReader != NULL … … 1015 1015 VirtualSystemDescriptionEntry *vsdeHD = *itH; 1016 1016 /* Find the disk from the OVF's disk list */ 1017 DiskImagesMap::const_iterator itDiskImage = reader.m_mapDisks.find(vsdeHD->strRef);1018 const DiskImage &di = itDiskImage->second;1017 ovf::DiskImagesMap::const_iterator itDiskImage = reader.m_mapDisks.find(vsdeHD->strRef); 1018 const ovf::DiskImage &di = itDiskImage->second; 1019 1019 Utf8StrFmt strSrcFilePath("%s%c%s", strSrcDir.c_str(), RTPATH_DELIMITER, di.strHref.c_str()); 1020 1020 filesList.push_back(strSrcFilePath); … … 1058 1058 } 1059 1059 1060 list< VirtualSystem>::const_iterator it;1060 list<ovf::VirtualSystem>::const_iterator it; 1061 1061 list< ComObjPtr<VirtualSystemDescription> >::const_iterator it1; 1062 1062 /* Iterate through all virtual systems of that appliance */ … … 1067 1067 ++it, ++it1, ++i) 1068 1068 { 1069 const VirtualSystem &vsysThis = *it;1069 const ovf::VirtualSystem &vsysThis = *it; 1070 1070 ComObjPtr<VirtualSystemDescription> vsdescThis = (*it1); 1071 1071 … … 1456 1456 1457 1457 // find the IDE controller 1458 const HardDiskController *pController = NULL;1459 for ( ControllersMap::const_iterator kt = vsysThis.mapControllers.begin();1458 const ovf::HardDiskController *pController = NULL; 1459 for (ovf::ControllersMap::const_iterator kt = vsysThis.mapControllers.begin(); 1460 1460 kt != vsysThis.mapControllers.end(); 1461 1461 ++kt) 1462 1462 { 1463 if (kt->second.system == HardDiskController::IDE)1463 if (kt->second.system == ovf::HardDiskController::IDE) 1464 1464 { 1465 1465 pController = &kt->second; … … 1552 1552 1553 1553 /* Find the disk from the OVF's disk list */ 1554 DiskImagesMap::const_iterator itDiskImage = reader.m_mapDisks.find(vsdeHD->strRef);1554 ovf::DiskImagesMap::const_iterator itDiskImage = reader.m_mapDisks.find(vsdeHD->strRef); 1555 1555 /* vsdeHD->strRef contains the disk identifier (e.g. "vmdisk1"), which should exist 1556 1556 in the virtual system's disks map under that ID and also in the global images map. */ 1557 VirtualDisksMap::const_iterator itVirtualDisk = vsysThis.mapVirtualDisks.find(vsdeHD->strRef);1557 ovf::VirtualDisksMap::const_iterator itVirtualDisk = vsysThis.mapVirtualDisks.find(vsdeHD->strRef); 1558 1558 1559 1559 if ( itDiskImage == reader.m_mapDisks.end() … … 1563 1563 tr("Internal inconsistency looking up disk images.")); 1564 1564 1565 const DiskImage &di = itDiskImage->second;1566 const VirtualDisk &vd = itVirtualDisk->second;1565 const ovf::DiskImage &di = itDiskImage->second; 1566 const ovf::VirtualDisk &vd = itVirtualDisk->second; 1567 1567 1568 1568 /* Make sure all target directories exists */ … … 1659 1659 1660 1660 /* For now we assume we have one controller of every type only */ 1661 HardDiskController hdc = (*vsysThis.mapControllers.find(vd.idController)).second;1661 ovf::HardDiskController hdc = (*vsysThis.mapControllers.find(vd.idController)).second; 1662 1662 1663 1663 // this is for rollback later -
trunk/src/VBox/Main/include/ApplianceImpl.h
r27895 r27908 28 28 #include "VirtualBoxBase.h" 29 29 30 #include "ovfreader.h"31 32 30 /* VBox forward declarations */ 33 31 class Progress; 34 32 class VirtualSystemDescription; 33 34 namespace ovf 35 { 36 struct HardDiskController; 37 class OVFReader; 38 } 39 40 namespace xml 41 { 42 class ElementNode; 43 } 35 44 36 45 class ATL_NO_VTABLE Appliance : … … 123 132 HRESULT readS3(TaskOVF *pTask); 124 133 125 void convertDiskAttachmentValues(const HardDiskController &hdc,134 void convertDiskAttachmentValues(const ovf::HardDiskController &hdc, 126 135 uint32_t ulAddressOnParent, 127 136 Bstr &controllerType, -
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r27895 r27908 24 24 25 25 class VirtualSystemDescription; 26 27 #include "ovfreader.h" 26 28 27 29 //////////////////////////////////////////////////////////////////////////////// … … 68 70 LocationInfo locInfo; // location info for the currently processed OVF 69 71 70 OVFReader*pReader;72 ovf::OVFReader *pReader; 71 73 72 74 bool fBusyWriting; // state protection; while this is true nobody else can call methods … … 150 152 //////////////////////////////////////////////////////////////////////////////// 151 153 152 void convertCIMOSType2VBoxOSType(Utf8Str &strType, CIMOSType_T c, const Utf8Str &cStr);154 void convertCIMOSType2VBoxOSType(Utf8Str &strType, ovf::CIMOSType_T c, const Utf8Str &cStr); 153 155 154 CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVbox);156 ovf::CIMOSType_T convertVBoxOSType2CIMOSType(const char *pcszVbox); 155 157 156 158 #endif // ____H_APPLIANCEIMPLPRIVATE -
trunk/src/VBox/Main/include/ovfreader.h
r25348 r27908 27 27 #include "iprt/cpp/xml.h" 28 28 #include <map> 29 30 namespace ovf 31 { 29 32 30 33 //////////////////////////////////////////////////////////////////////////////// … … 166 169 }; 167 170 168 enum OVFResourceType_T169 { OVFResourceType_Other = 1,170 OVFResourceType_ComputerSystem = 2,171 OVFResourceType_Processor = 3,172 OVFResourceType_Memory = 4,173 OVFResourceType_IDEController = 5,174 OVFResourceType_ParallelSCSIHBA = 6,175 OVFResourceType_FCHBA = 7,176 OVFResourceType_iSCSIHBA = 8,177 OVFResourceType_IBHCA = 9,178 OVFResourceType_EthernetAdapter = 10,179 OVFResourceType_OtherNetworkAdapter = 11,180 OVFResourceType_IOSlot = 12,181 OVFResourceType_IODevice = 13,182 OVFResourceType_FloppyDrive = 14,183 OVFResourceType_CDDrive = 15,184 OVFResourceType_DVDDrive = 16,185 OVFResourceType_HardDisk = 17,186 OVFResourceType_OtherStorageDevice = 20,187 OVFResourceType_USBController = 23,188 OVFResourceType_SoundCard = 35171 enum ResourceType_T 172 { ResourceType_Other = 1, 173 ResourceType_ComputerSystem = 2, 174 ResourceType_Processor = 3, 175 ResourceType_Memory = 4, 176 ResourceType_IDEController = 5, 177 ResourceType_ParallelSCSIHBA = 6, 178 ResourceType_FCHBA = 7, 179 ResourceType_iSCSIHBA = 8, 180 ResourceType_IBHCA = 9, 181 ResourceType_EthernetAdapter = 10, 182 ResourceType_OtherNetworkAdapter = 11, 183 ResourceType_IOSlot = 12, 184 ResourceType_IODevice = 13, 185 ResourceType_FloppyDrive = 14, 186 ResourceType_CDDrive = 15, 187 ResourceType_DVDDrive = 16, 188 ResourceType_HardDisk = 17, 189 ResourceType_OtherStorageDevice = 20, 190 ResourceType_USBController = 23, 191 ResourceType_SoundCard = 35 189 192 }; 190 193 … … 198 201 uint32_t ulParent; 199 202 200 OVFResourceType_T resourceType;203 ResourceType_T resourceType; 201 204 iprt::MiniString strOtherResourceType; 202 205 iprt::MiniString strResourceSubType; … … 394 397 }; 395 398 399 } // end namespace ovf 400 396 401 #endif // ____H_OVFREADER -
trunk/src/VBox/Main/xml/ovfreader.cpp
r22173 r27908 26 26 using namespace std; 27 27 using namespace iprt; 28 using namespace ovf; 28 29 29 30 //////////////////////////////////////////////////////////////////////////////// … … 368 369 uint32_t ulType; 369 370 pelmItemChild->copyValue(ulType); 370 i.resourceType = ( OVFResourceType_T)ulType;371 i.resourceType = (ResourceType_T)ulType; 371 372 } 372 373 else if (!strcmp(pcszItemChildName, "OtherResourceType")) … … 428 429 switch (i.resourceType) 429 430 { 430 case OVFResourceType_Processor: // 3431 case ResourceType_Processor: // 3 431 432 /* <rasd:Caption>1 virtual CPU</rasd:Caption> 432 433 <rasd:Description>Number of virtual CPUs</rasd:Description> … … 445 446 break; 446 447 447 case OVFResourceType_Memory: // 4448 case ResourceType_Memory: // 4 448 449 if ( (i.strAllocationUnits == "MegaBytes") // found in OVF created by OVF toolkit 449 450 || (i.strAllocationUnits == "MB") // found in MS docs … … 458 459 break; 459 460 460 case OVFResourceType_IDEController: // 5461 case ResourceType_IDEController: // 5 461 462 { 462 463 /* <Item> … … 479 480 break; 480 481 481 case OVFResourceType_ParallelSCSIHBA: // 6 SCSI controller482 case ResourceType_ParallelSCSIHBA: // 6 SCSI controller 482 483 { 483 484 /* <Item> … … 498 499 break; 499 500 500 case OVFResourceType_EthernetAdapter: // 10501 case ResourceType_EthernetAdapter: // 10 501 502 { 502 503 /* <Item> … … 524 525 break; 525 526 526 case OVFResourceType_FloppyDrive: // 14527 case ResourceType_FloppyDrive: // 14 527 528 vsys.fHasFloppyDrive = true; // we have no additional information 528 529 break; 529 530 530 case OVFResourceType_CDDrive: // 15531 case ResourceType_CDDrive: // 15 531 532 /* <Item ovf:required="false"> 532 533 <rasd:Caption>cdrom1</rasd:Caption> … … 543 544 break; 544 545 545 case OVFResourceType_HardDisk: // 17546 case ResourceType_HardDisk: // 17 546 547 // handled separately in second loop below 547 548 break; 548 549 549 case OVFResourceType_OtherStorageDevice: // 20 SATA controller550 case ResourceType_OtherStorageDevice: // 20 SATA controller 550 551 { 551 552 /* <Item> … … 572 573 throw OVFLogicError(N_("Error reading \"%s\": Host resource of type \"Other Storage Device (%d)\" is supported with SATA AHCI controllers only, line %d"), 573 574 m_strPath.c_str(), 574 OVFResourceType_OtherStorageDevice,575 ResourceType_OtherStorageDevice, 575 576 i.ulLineNumber); 576 577 } 577 578 break; 578 579 579 case OVFResourceType_USBController: // 23580 case ResourceType_USBController: // 23 580 581 /* <Item ovf:required="false"> 581 582 <rasd:Caption>usb</rasd:Caption> … … 589 590 break; 590 591 591 case OVFResourceType_SoundCard: // 35592 case ResourceType_SoundCard: // 35 592 593 /* <Item ovf:required="false"> 593 594 <rasd:Caption>sound</rasd:Caption> … … 622 623 switch (i.resourceType) 623 624 { 624 case OVFResourceType_HardDisk: // 17625 case ResourceType_HardDisk: // 17 625 626 { 626 627 /* <Item>
Note:
See TracChangeset
for help on using the changeset viewer.