VirtualBox

Changeset 98782 in vbox


Ignore:
Timestamp:
Feb 28, 2023 2:40:28 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156093
Message:

bugref:9782. The default values for VirtualSystemDescriptionType_CPU, VirtualSystemDescriptionType_Memory, VirtualSystemDescriptionType_SoundCard, VirtualSystemDescriptionType_Description are used now. Checked for VirtualSystemDescriptionType_SettingsFile in VirtualSystemDescription to get the path to the target machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r98322 r98782  
    14591459    /* Should be defined here because it's used later, at least when ComposeMachineFilename() is called */
    14601460    Utf8Str strVMName("VM_exported_from_cloud");
     1461    Utf8Str strVMGroup("/");
     1462    Utf8Str strVMBaseFolder;
     1463    Utf8Str strVMSettingFilePath;
    14611464
    14621465    if (m->virtualSystemDescriptions.size() == 1)
     
    14911494            }
    14921495
    1493             /* Check the target path. If the path exists and folder isn't empty return an error */
    1494             {
    1495                 Bstr bstrSettingsFilename;
     1496            Bstr bstrSettingsFilename;
     1497            GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_SettingsFile);
     1498            if (aVBoxValues.size() == 0)
     1499            {
     1500                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_PrimaryGroup);
     1501                if (aVBoxValues.size() != 0)
     1502                    strVMGroup = aVBoxValues[0];
     1503
     1504                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_BaseFolder);
     1505                if (aVBoxValues.size() != 0)
     1506                    strVMBaseFolder = aVBoxValues[0];
     1507
    14961508                /* Based on the VM name, create a target machine path. */
    14971509                hrc = mVirtualBox->ComposeMachineFilename(Bstr(strVMName).raw(),
    1498                                                           Bstr("/").raw(),
     1510                                                          Bstr(strVMGroup).raw(),
    14991511                                                          NULL /* aCreateFlags */,
    1500                                                           NULL /* aBaseFolder */,
     1512                                                          Bstr(strVMBaseFolder).raw(),
    15011513                                                          bstrSettingsFilename.asOutParam());
    15021514                if (FAILED(hrc))
    15031515                    break;
    1504 
     1516            }
     1517            else
     1518            {
     1519                bstrSettingsFilename = aVBoxValues[0];
     1520                vsd->AddDescription(VirtualSystemDescriptionType_SettingsFile,
     1521                                    bstrSettingsFilename.raw(),
     1522                                    NULL);
     1523            }
     1524
     1525            {
     1526                // CPU count
     1527                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_CPU);
     1528                if (aVBoxValues.size() == 0)//1 CPU by default
     1529                    vsd->AddDescription(VirtualSystemDescriptionType_CPU,
     1530                                        Bstr("1").raw(),
     1531                                        NULL);
     1532
     1533                // RAM
     1534                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_Memory);
     1535                if (aVBoxValues.size() == 0)//1000MB by default
     1536                    vsd->AddDescription(VirtualSystemDescriptionType_Memory,
     1537                                        Bstr("1000").raw(),
     1538                                        NULL);
     1539
     1540                // audio adapter
     1541                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_SoundCard);
     1542//              if (aVBoxValues.size() == 0)
     1543//                  vsd->AddDescription(VirtualSystemDescriptionType_SoundCard,
     1544//                                      Bstr("SB16").raw(),
     1545//                                      NULL);
     1546
     1547                //description
     1548                GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_Description);
     1549                if (aVBoxValues.size() == 0)
     1550                    vsd->AddDescription(VirtualSystemDescriptionType_Description,
     1551                                        Bstr("There is no description for this VM").raw(),
     1552                                        NULL);
     1553            }
     1554
     1555            {
    15051556                Utf8Str strMachineFolder(bstrSettingsFilename);
    15061557                strMachineFolder.stripFilename();
Note: See TracChangeset for help on using the changeset viewer.

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