VirtualBox

Changeset 92223 in vbox


Ignore:
Timestamp:
Nov 4, 2021 9:15:15 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148056
Message:

Main/Settings: Remove the unnecessary additional settings version. bugref:9932

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r92154 r92223  
    611611    </const>
    612612    <const name="v1_19" value="21">
    613       <desc>Settings version "1.19", written by VirtualBox 6.2.x.</desc>
    614       <!--
    615           Machine changes: IOMMU device.
    616       -->
    617     </const>
    618     <const name="v1_20" value="22">
    619       <desc>Settings version "1.20", written by VirtualBox 7.0.x.</desc>
     613      <desc>Settings version "1.19", written by VirtualBox 7.0.x.</desc>
    620614      <!--
    621615          VirtualBox.xml additions: HostOnlyNetworks in NetserviceRegistry
    622           NetworkAdapter changes: HostOnlyNetwork mode.
     616          Machine changes: IOMMU device, HostOnlyNetwork mode for
     617          NetworkAdapter.
    623618      -->
    624619    </const>
    625620    <const name="Future" value="99999">
    626       <desc>Settings version greater than "1.20", written by a future VirtualBox version.</desc>
     621      <desc>Settings version greater than "1.19", written by a future VirtualBox version.</desc>
    627622    </const>
    628623  </enum>
  • trunk/src/VBox/Main/xml/Settings.cpp

    r92133 r92223  
    413413            else if (uMinor == 19)
    414414                sv = SettingsVersion_v1_19;
    415 #ifndef VBOX_WITH_VMNET
    416415            else if (uMinor > 19)
    417 #else /* VBOX_WITH_VMNET */
    418             else if (uMinor == 20)
    419                 sv = SettingsVersion_v1_20;
    420             else if (uMinor > 20)
    421 #endif /* VBOX_WITH_VMNET */
    422416                sv = SettingsVersion_Future;
    423417        }
     
    10551049            break;
    10561050
    1057 #ifdef VBOX_WITH_VMNET
    1058         case SettingsVersion_v1_20:
    1059             pcszVersion = "1.20";
    1060             break;
    1061 #endif /* VBOX_WITH_VMNET */
    1062 
    10631051        default:
    10641052            // catch human error: the assertion below will trigger in debug
     
    10831071                // but as it's an omission of someone who changed this file
    10841072                // it's the only generic possibility.
    1085 #ifndef VBOX_WITH_VMNET
    10861073                pcszVersion = "1.19";
    10871074                m->sv = SettingsVersion_v1_19;
    1088 #else /* VBOX_WITH_VMNET */
    1089                 pcszVersion = "1.20";
    1090                 m->sv = SettingsVersion_v1_20;
    1091 #endif /* VBOX_WITH_VMNET */
    10921075            }
    10931076            break;
     
    24142397{
    24152398#ifdef VBOX_WITH_VMNET
    2416     if (m->sv < SettingsVersion_v1_20)
     2399    if (m->sv < SettingsVersion_v1_19)
    24172400    {
    24182401        // VirtualBox 7.0 adds support for host-only networks.
    24192402        if (!llHostOnlyNetworks.empty())
    2420             m->sv = SettingsVersion_v1_20;
     2403            m->sv = SettingsVersion_v1_19;
    24212404    }
    24222405#endif /* VBOX_WITH_VMNET */
     
    79627945void MachineConfigFile::bumpSettingsVersionIfNeeded()
    79637946{
    7964 #ifdef VBOX_WITH_VMNET
    7965     if (m->sv < SettingsVersion_v1_20)
    7966     {
    7967         // VirtualBox 7.0 adds a host-only network attachment.
     7947    if (m->sv < SettingsVersion_v1_19)
     7948    {
     7949        // VirtualBox 7.0 adds iommu device.
     7950        if (hardwareMachine.iommuType != IommuType_None)
     7951        {
     7952            m->sv = SettingsVersion_v1_19;
     7953            return;
     7954        }
     7955
     7956        // VirtualBox 7.0 adds a Trusted Platform Module.
     7957        if (   hardwareMachine.tpmSettings.tpmType != TpmType_None
     7958            || hardwareMachine.tpmSettings.strLocation.isNotEmpty())
     7959        {
     7960            m->sv = SettingsVersion_v1_19;
     7961            return;
     7962        }
     7963
    79687964        NetworkAdaptersList::const_iterator netit;
    79697965        for (netit = hardwareMachine.llNetworkAdapters.begin();
     
    79717967             ++netit)
    79727968        {
    7973             if (netit->mode == NetworkAttachmentType_HostOnlyNetwork)
    7974             {
    7975                 m->sv = SettingsVersion_v1_20;
    7976                 break;
    7977             }
    7978         }
    7979     }
    7980 #endif /* VBOX_WITH_VMNET */
    7981     if (m->sv < SettingsVersion_v1_19)
    7982     {
    7983         // VirtualBox 6.2 adds iommu device.
    7984         if (hardwareMachine.iommuType != IommuType_None)
    7985         {
    7986             m->sv = SettingsVersion_v1_19;
    7987             return;
    7988         }
    7989 
    7990         // VirtualBox 6.2 adds a Trusted Platform Module.
    7991         if (   hardwareMachine.tpmSettings.tpmType != TpmType_None
    7992             || hardwareMachine.tpmSettings.strLocation.isNotEmpty())
    7993         {
    7994             m->sv = SettingsVersion_v1_19;
    7995             return;
    7996         }
    7997 
    7998         NetworkAdaptersList::const_iterator netit;
    7999         for (netit = hardwareMachine.llNetworkAdapters.begin();
    8000              netit != hardwareMachine.llNetworkAdapters.end();
    8001              ++netit)
    8002         {
     7969            // VirtualBox 7.0 adds a flag if NAT can reach localhost.
    80037970            if (   netit->fEnabled
    80047971                && netit->mode == NetworkAttachmentType_NAT
     
    80087975                break;
    80097976            }
     7977
     7978#ifdef VBOX_WITH_VMNET
     7979            // VirtualBox 7.0 adds a host-only network attachment.
     7980            if (netit->mode == NetworkAttachmentType_HostOnlyNetwork)
     7981            {
     7982                m->sv = SettingsVersion_v1_19;
     7983                break;
     7984            }
     7985#endif /* VBOX_WITH_VMNET */
    80107986        }
    80117987    }
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