VirtualBox

Changeset 36395 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 24, 2011 11:54:52 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70748
Message:

Main/xml/Settings: fAutoReset and hdType were sometimes not correctly initialized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r36275 r36395  
    694694            med.strFormat = "RAW";
    695695        }
     696   
     697        if (t == DVDImage)
     698            med.hdType = MediumType_Readonly;
     699        else if (t == FloppyImage)
     700            med.hdType = MediumType_Writethrough;
    696701    }
    697702
     
    10131018    if (devType == DeviceType_HardDisk || RTStrICmp(mdm.strFormat.c_str(), "RAW"))
    10141019        pelmMedium->setAttribute("format", mdm.strFormat);
    1015     if (mdm.fAutoReset)
     1020    if (   devType == DeviceType_HardDisk
     1021        && mdm.fAutoReset)
    10161022        pelmMedium->setAttribute("autoReset", mdm.fAutoReset);
    10171023    if (mdm.strDescription.length())
     
    10301036    if (level == 0)
    10311037    {
    1032         const char *pcszType =
    1033             mdm.hdType == MediumType_Normal ? "Normal" :
    1034             mdm.hdType == MediumType_Immutable ? "Immutable" :
    1035             mdm.hdType == MediumType_Writethrough ? "Writethrough" :
    1036             mdm.hdType == MediumType_Shareable ? "Shareable" :
    1037             mdm.hdType == MediumType_Readonly ? "Readonly" :
    1038             mdm.hdType == MediumType_MultiAttach ? "MultiAttach" :
    1039             "INVALID";
    10401038        // no need to save the usual DVD/floppy medium types
    10411039        if (   (   devType != DeviceType_DVD
     
    10441042            && (   devType != DeviceType_Floppy
    10451043                || mdm.hdType != MediumType_Writethrough))
     1044        {
     1045            const char *pcszType =
     1046                mdm.hdType == MediumType_Normal ? "Normal" :
     1047                mdm.hdType == MediumType_Immutable ? "Immutable" :
     1048                mdm.hdType == MediumType_Writethrough ? "Writethrough" :
     1049                mdm.hdType == MediumType_Shareable ? "Shareable" :
     1050                mdm.hdType == MediumType_Readonly ? "Readonly" :
     1051                mdm.hdType == MediumType_MultiAttach ? "MultiAttach" :
     1052                "INVALID";
    10461053            pelmMedium->setAttribute("type", pcszType);
     1054        }
    10471055    }
    10481056
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