- Timestamp:
- Nov 30, 2010 12:30:30 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplImport.cpp
r34101 r34501 163 163 pNewDesc->importVboxMachineXML(*vsysThis.pelmVboxMachine); 164 164 165 /* Guest OS type */ 165 // Guest OS type 166 // This is taken from one of three places, in this order: 166 167 Utf8Str strOsTypeVBox; 167 Utf8Str strCIMOSType = Utf8StrFmt("%RU32", (uint32_t)vsysThis.cimos); 168 /* If there is a vbox.xml, we always prefer the ostype settings 169 * from there, cause OVF doesn't know all types VBox know. */ 168 Utf8StrFmt strCIMOSType("%RU32", (uint32_t)vsysThis.cimos); 169 // 1) If there is a <vbox:Machine>, then use the type from there. 170 170 if ( vsysThis.pelmVboxMachine 171 && pNewDesc->m->pConfig->machineUserData.strOsType.isNotEmpty()) 171 && pNewDesc->m->pConfig->machineUserData.strOsType.isNotEmpty() 172 ) 172 173 strOsTypeVBox = pNewDesc->m->pConfig->machineUserData.strOsType; 174 // 2) Otherwise, if there is OperatingSystemSection/vbox:OSType, use that one. 175 else if (vsysThis.strTypeVbox.isNotEmpty()) // OVFReader has found vbox:OSType 176 strOsTypeVBox = vsysThis.strTypeVbox; 177 // 3) Otherwise, make a best guess what the vbox type is from the OVF (CIM) OS type. 173 178 else 174 179 convertCIMOSType2VBoxOSType(strOsTypeVBox, vsysThis.cimos, vsysThis.strCimosDesc); … … 180 185 /* VM name */ 181 186 Utf8Str nameVBox; 182 /* If there is a vbox.xml, we always prefer the setting from there. */187 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 183 188 if ( vsysThis.pelmVboxMachine 184 189 && pNewDesc->m->pConfig->machineUserData.strName.isNotEmpty()) … … 261 266 /* CPU count */ 262 267 ULONG cpuCountVBox; 263 /* If there is a vbox.xml, we always prefer the setting from there. */268 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 264 269 if ( vsysThis.pelmVboxMachine 265 270 && pNewDesc->m->pConfig->hardwareMachine.cCPUs) … … 283 288 /* RAM */ 284 289 uint64_t ullMemSizeVBox; 285 /* If there is a vbox.xml, we always prefer the setting from there. */290 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 286 291 if ( vsysThis.pelmVboxMachine 287 292 && pNewDesc->m->pConfig->hardwareMachine.ulMemorySizeMB) … … 317 322 Utf8Str strSoundCard; 318 323 Utf8Str strSoundCardOrig; 319 /* If there is a vbox.xml, we always prefer the setting from there. */324 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 320 325 if ( vsysThis.pelmVboxMachine 321 326 && pNewDesc->m->pConfig->hardwareMachine.audioAdapter.fEnabled) … … 336 341 #ifdef VBOX_WITH_USB 337 342 /* USB Controller */ 338 /* If there is a vbox.xml, we always prefer the setting from there. */343 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 339 344 if ( ( vsysThis.pelmVboxMachine 340 345 && pNewDesc->m->pConfig->hardwareMachine.usbController.fEnabled) … … 344 349 345 350 /* Network Controller */ 346 /* If there is a vbox.xml, we always prefer the setting from there. */351 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 347 352 if (vsysThis.pelmVboxMachine) 348 353 { … … 448 453 } 449 454 450 /* If there is a vbox.xml, we always prefer the setting from there. */455 /* If there is a <vbox:Machine>, we always prefer the setting from there. */ 451 456 bool fFloppy = false; 452 457 bool fDVD = false; -
trunk/src/VBox/Main/include/ovfreader.h
r33700 r34501 325 325 CIMOSType_T cimos; 326 326 iprt::MiniString strCimosDesc; // readable description of the cimos type in the case of cimos = 0/1/102 327 iprt::MiniString strTypeVbox; // optional type from @vbox:ostype attribute (VirtualBox 4.0 or higher) 328 327 329 iprt::MiniString strVirtualSystemType; // generic hardware description; OVF says this can be something like "vmx-4" or "xen"; 328 330 // VMware Workstation 6.5 is "vmx-07" … … 361 363 362 364 VirtualSystem() 363 : ullMemorySize(0), 365 : cimos(CIMOSType_CIMOS_Unknown), 366 ullMemorySize(0), 364 367 cCPUs(1), 365 368 fHasFloppyDrive(false), -
trunk/src/VBox/Main/xml/ovfreader.cpp
r33700 r34501 775 775 if ((pelmCIMOSDescription = pelmThis->findChildElement("Description"))) 776 776 vsys.strCimosDesc = pelmCIMOSDescription->getValue(); 777 778 const xml::ElementNode *pelmVBoxOSType; 779 if ((pelmVBoxOSType = pelmThis->findChildElement("vbox", // namespace 780 "OSType"))) // element name 781 vsys.strTypeVbox = pelmVBoxOSType->getValue(); 777 782 } 778 783 else if ( (!strcmp(pcszElemName, "AnnotationSection"))
Note:
See TracChangeset
for help on using the changeset viewer.