VirtualBox

Ignore:
Timestamp:
Jan 10, 2023 6:35:56 AM (2 years ago)
Author:
vboxsync
Message:

reimplemented changes for bugref:10180 after seperating the changes from bugref:4787

File:
1 edited

Legend:

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

    r97367 r98035  
    141141    bool            fMountOnly;
    142142    Utf8Str         strImagePath;
     143    bool            fAuxiliary;
    143144
    144145    UnattendedInstallationDisk(StorageBus_T a_enmBusType, Utf8Str const &a_rBusName, DeviceType_T a_enmDeviceType,
    145146                               AccessMode_T a_enmAccessType, LONG a_iPort, LONG a_iDevice, bool a_fMountOnly,
    146                                Utf8Str const &a_rImagePath)
     147                               Utf8Str const &a_rImagePath, bool a_fAuxiliary)
    147148        : enmBusType(a_enmBusType), strControllerName(a_rBusName), enmDeviceType(a_enmDeviceType), enmAccessType(a_enmAccessType)
    148         , iPort(a_iPort), iDevice(a_iDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath)
     149        , iPort(a_iPort), iDevice(a_iDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath), fAuxiliary(a_fAuxiliary)
    149150    {
    150151        Assert(strControllerName.length() > 0);
    151152    }
    152153
    153     UnattendedInstallationDisk(std::list<ControllerSlot>::const_iterator const &itDvdSlot, Utf8Str const &a_rImagePath)
     154    UnattendedInstallationDisk(std::list<ControllerSlot>::const_iterator const &itDvdSlot, Utf8Str const &a_rImagePath,
     155                               bool a_fAuxiliary)
    154156        : enmBusType(itDvdSlot->enmBus), strControllerName(itDvdSlot->strControllerName), enmDeviceType(DeviceType_DVD)
    155157        , enmAccessType(AccessMode_ReadOnly), iPort(itDvdSlot->iPort), iDevice(itDvdSlot->iDevice)
    156         , fMountOnly(!itDvdSlot->fFree), strImagePath(a_rImagePath)
     158        , fMountOnly(!itDvdSlot->fFree), strImagePath(a_rImagePath), fAuxiliary(a_fAuxiliary)
    157159    {
    158160        Assert(strControllerName.length() > 0);
     
    30523054                                                                 0, 0,
    30533055                                                                 fFoundPort0Dev0 /*fMountOnly*/,
    3054                                                                  mpInstaller->getAuxiliaryFloppyFilePath()));
     3056                                                                 mpInstaller->getAuxiliaryFloppyFilePath(), false));
    30553057    return S_OK;
    30563058}
     
    32113213    if (mpInstaller->isAuxiliaryIsoNeeded() && mpInstaller->bootFromAuxiliaryIso())
    32123214    {
    3213         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
     3215        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath(), true));
    32143216        ++itDvdSlot;
    32153217    }
     
    32173219    if (mpInstaller->isOriginalIsoNeeded())
    32183220    {
    3219         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getIsoPath()));
     3221        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getIsoPath(), false));
    32203222        ++itDvdSlot;
    32213223    }
     
    32233225    if (mpInstaller->isAuxiliaryIsoNeeded() && !mpInstaller->bootFromAuxiliaryIso())
    32243226    {
    3225         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
     3227        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath(), true));
    32263228        ++itDvdSlot;
    32273229    }
     
    32303232    if (mpInstaller->isAdditionsIsoNeeded())
    32313233    {
    3232         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getAdditionsIsoPath()));
     3234        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getAdditionsIsoPath(), false));
    32333235        ++itDvdSlot;
    32343236    }
     
    32363238    if (mpInstaller->isValidationKitIsoNeeded())
    32373239    {
    3238         rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getValidationKitIsoPath()));
     3240        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getValidationKitIsoPath(), false));
    32393241        ++itDvdSlot;
    32403242    }
     
    42074209
    42084210    ComPtr<IMedium> ptrMedium;
    4209     HRESULT rc = mParent->OpenMedium(Bstr(pImage->strImagePath).raw(),
     4211    HRESULT hrc = mParent->OpenMedium(Bstr(pImage->strImagePath).raw(),
    42104212                                     pImage->enmDeviceType,
    42114213                                     pImage->enmAccessType,
    42124214                                     true,
    42134215                                     ptrMedium.asOutParam());
    4214     LogRelFlowFunc(("VirtualBox::openMedium -> %Rhrc\n", rc));
    4215     if (SUCCEEDED(rc))
    4216     {
     4216    LogRelFlowFunc(("VirtualBox::openMedium -> %Rhrc\n", hrc));
     4217    if (SUCCEEDED(hrc))
     4218    {
     4219        if (pImage->fAuxiliary && pImage->strImagePath.endsWith(".viso"))
     4220        {
     4221            hrc = ptrMedium->SetProperty(Bstr("UnattendedInstall").raw(), Bstr("1").raw());
     4222            LogRelFlowFunc(("Medium::SetProperty -> %Rhrc\n", hrc));
     4223        }
    42174224        if (pImage->fMountOnly)
    42184225        {
    42194226            // mount the opened disk image
    4220             rc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage->iPort,
    4221                                                  pImage->iDevice, ptrMedium, TRUE /*fForce*/);
    4222             LogRelFlowFunc(("Machine::MountMedium -> %Rhrc\n", rc));
     4227            hrc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage->iPort,
     4228                                                  pImage->iDevice, ptrMedium, TRUE /*fForce*/);
     4229            LogRelFlowFunc(("Machine::MountMedium -> %Rhrc\n", hrc));
    42234230        }
    42244231        else
    42254232        {
    42264233            //attach the opened disk image to the controller
    4227             rc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage->iPort,
    4228                                                   pImage->iDevice, pImage->enmDeviceType, ptrMedium);
    4229             LogRelFlowFunc(("Machine::AttachDevice -> %Rhrc\n", rc));
     4234            hrc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage->iPort,
     4235                                                   pImage->iDevice, pImage->enmDeviceType, ptrMedium);
     4236            LogRelFlowFunc(("Machine::AttachDevice -> %Rhrc\n", hrc));
    42304237        }
    42314238    }
    42324239
    42334240    rLock.acquire();
    4234     return rc;
     4241    return hrc;
    42354242}
    42364243
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