VirtualBox

Changeset 23854 in vbox


Ignore:
Timestamp:
Oct 19, 2009 11:34:03 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53622
Message:

FE/Qt4: Implicitly set SATA ports count when saving storage settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsHD.cpp

    r23723 r23854  
    17811781            CStorageController ctr = mMachine.AddStorageController (ctrName, ctrBusType);
    17821782            ctr.SetControllerType (ctrType);
     1783            int maxUsedPort = -1;
    17831784            for (int j = 0; j < mStorageModel->rowCount (ctrIndex); ++ j)
    17841785            {
     
    17911792                attachment.SetPassthrough (mStorageModel->data (attIndex, StorageModel::R_AttIsHostDrive).toBool() &&
    17921793                                           mStorageModel->data (attIndex, StorageModel::R_AttIsPassthrough).toBool());
     1794                maxUsedPort = attStorageSlot.port > maxUsedPort ? attStorageSlot.port : maxUsedPort;
     1795            }
     1796            if (ctrBusType == KStorageBus_SATA)
     1797            {
     1798                ULONG sataPortsCount = maxUsedPort + 1;
     1799                sataPortsCount = qMax (sataPortsCount, ctr.GetMinPortCount());
     1800                sataPortsCount = qMin (sataPortsCount, ctr.GetMaxPortCount());
     1801                ctr.SetPortCount (sataPortsCount);
    17931802            }
    17941803        }
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