VirtualBox

Changeset 101139 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 18, 2023 10:58:57 AM (15 months ago)
Author:
vboxsync
Message:

Main: Added new define VBOX_WITH_ARMV8_HARDCODED_DEFAULTS (enabled by default for darwin.arm64) which sets some hardcoded defaults for newly created VMs. This is needed at least for now to get new VMs off the ground. bugref:10384

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r101035 r101139  
    571571        $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,) \
    572572        $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,) \
    573         $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,)
     573        $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,) \
     574        $(if $(VBOX_WITH_ARMV8_HARDCODED_DEFAULTS),VBOX_WITH_ARMV8_HARDCODED_DEFAULTS,)
    574575 ifdef VBOX_WITH_USB
    575576  VBoxSVC_DEFS += \
  • trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp

    r98103 r101139  
    5454    , mAudioCodecType(AudioCodecType_STAC9700)
    5555{
     56#ifdef VBOX_WITH_ARMV8_HARDCODED_DEFAULTS
     57    unconst(mGraphicsControllerType)    = GraphicsControllerType_VMSVGA;
     58    unconst(mVRAMSize)                  = 128; /* MB */
     59# ifdef VBOX_WITH_E1000
     60    unconst(mNetworkAdapterType)        = NetworkAdapterType_I82540EM;
     61# endif
     62    unconst(mNumSerialEnabled)          = 1;
     63    unconst(mDVDStorageControllerType)  = StorageControllerType_VirtioSCSI;
     64    unconst(mDVDStorageBusType)         = StorageBus_VirtioSCSI;
     65    unconst(mHDStorageControllerType)   = StorageControllerType_VirtioSCSI;
     66    unconst(mHDStorageBusType)          = StorageBus_VirtioSCSI;
     67    unconst(mChipsetType)               = ChipsetType_ARMv8Virtual;
     68#endif /* VBOX_WITH_ARMV8_HARDCODED_DEFAULTS */
    5669}
    5770
     
    106119    unconst(mRAMSize)                   = ostype.recommendedRAM;
    107120    unconst(mCPUCount)                  = ostype.recommendedCPUCount;
     121    unconst(mHDDSize)                   = ostype.recommendedHDD;
     122#ifndef VBOX_WITH_ARMV8_HARDCODED_DEFAULTS
    108123    unconst(mGraphicsControllerType)    = ostype.graphicsControllerType;
    109124    unconst(mVRAMSize)                  = ostype.recommendedVRAM;
    110     unconst(mHDDSize)                   = ostype.recommendedHDD;
    111125    unconst(mNetworkAdapterType)        = ostype.networkAdapterType;
    112126    unconst(mNumSerialEnabled)          = ostype.numSerialEnabled;
     
    116130    unconst(mHDStorageBusType)          = ostype.hdStorageBusType;
    117131    unconst(mChipsetType)               = ostype.chipsetType;
     132#endif
    118133    unconst(mIommuType)                 = ostype.iommuType;
    119134    unconst(mAudioControllerType)       = ostype.audioControllerType;
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r101138 r101139  
    506506        hrc = mNvramStore->i_updateEncryptionSettings(strNVRAMKeyId, strNVRAMKeyStore);
    507507#endif
     508
     509#ifdef VBOX_WITH_ARMV8_HARDCODED_DEFAULTS
     510        /* At least one serial port has to be enabled. */
     511        char szPathTemp[RTPATH_MAX];
     512        int vrc = RTPathTemp(szPathTemp, sizeof(szPathTemp)); /* Don't clutter the VM directory; instead use the temp dir. */
     513        if (RT_SUCCESS(vrc))
     514        {
     515            vrc = RTPathAppend(szPathTemp, sizeof(szPathTemp), strName.c_str());
     516            if (RT_SUCCESS(vrc))
     517            {
     518                vrc = RTStrCat(szPathTemp, sizeof(szPathTemp), "-serialPort0");
     519                if (RT_SUCCESS(vrc))
     520                {
     521                    mSerialPorts[0]->COMSETTER(Path)(Bstr(szPathTemp).raw()); /* Must be set first. */
     522                    mSerialPorts[0]->COMSETTER(HostMode)(PortMode_RawFile);
     523                    mSerialPorts[0]->COMSETTER(Enabled)(TRUE);
     524                }
     525            }
     526        }
     527        /* Always needs EFI. */
     528        mFirmwareSettings->COMSETTER(FirmwareType)(FirmwareType_EFI);
     529        /* Needs VMSVGA for now. */
     530        mGraphicsAdapter->COMSETTER(GraphicsControllerType)(GraphicsControllerType_VMSVGA);
     531        mGraphicsAdapter->COMSETTER(VRAMSize)(128 /* MB */);
     532#endif /* VBOX_WITH_ARMV8_HARDCODED_DEFAULTS */
     533
    508534        if (SUCCEEDED(hrc))
    509535        {
     
    1524115267        mNetworkAdapters[slot]->i_applyDefaults(osType);
    1524215268
     15269#ifdef VBOX_WITH_ARMV8_HARDCODED_DEFAULTS
     15270        /* Configuration is done in Machine::init(). */
     15271#else
    1524315272    /* Apply serial port defaults */
    1524415273    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    1524515274        mSerialPorts[slot]->i_applyDefaults(osType);
     15275#endif
    1524615276
    1524715277    /* Apply parallel port defaults  - not OS dependent*/
     
    1533515365    else if (dvdStorageControllerType == StorageControllerType_IntelAhci)
    1533615366        storageController->COMSETTER(PortCount)(1);
     15367
     15368#ifdef VBOX_WITH_ARMV8_HARDCODED_DEFAULTS
     15369    /* ARM VMs only support VirtioSCSI for now -- set two ports here, one for HDD and one for DVD drive. */
     15370    if (hdStorageControllerType == StorageControllerType_VirtioSCSI)
     15371    {
     15372        hrc = storageController->COMSETTER(PortCount)(2);
     15373        if (FAILED(hrc)) return hrc;
     15374    }
     15375#endif
    1533715376
    1533815377    /* USB stuff */
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