Changeset 24274 in vbox
- Timestamp:
- Nov 2, 2009 6:51:09 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/xml/Settings.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r24250 r24274 1450 1450 if (elmHardware.getAttributeValue("uuid", strUUID)) 1451 1451 parseUUID(hw.uuid, strUUID); 1452 else1453 hw.uuid.clear();1454 1452 1455 1453 xml::NodesLoop nl1(elmHardware); … … 1863 1861 } 1864 1862 1865 if (!pelmController->getAttributeValue("Instance", sctl.ulInstance))1866 sctl.ulInstance = 0;1863 pelmController->getAttributeValue("Instance", sctl.ulInstance); 1864 // default from constructor is 0 1867 1865 1868 1866 Utf8Str strType; … … 2340 2338 if (hw.strVersion != "2") 2341 2339 pelmHardware->setAttribute("version", hw.strVersion); 2342 if (!hw.uuid.isEmpty()) 2340 if ( (m->sv >= SettingsVersion_v1_9) 2341 && (!hw.uuid.isEmpty()) 2342 ) 2343 2343 pelmHardware->setAttribute("uuid", makeString(hw.uuid)); 2344 2344 … … 2739 2739 pelmController->setAttribute("PortCount", sc.ulPortCount); 2740 2740 2741 pelmController->setAttribute("Instance", sc.ulInstance); 2741 if (m->sv >= SettingsVersion_v1_9) 2742 if (sc.ulInstance) 2743 pelmController->setAttribute("Instance", sc.ulInstance); 2742 2744 2743 2745 if (sc.controllerType == StorageControllerType_IntelAhci) … … 2755 2757 const AttachedDevice &att = *it2; 2756 2758 2757 /* DVD/Floppy is handled already for settings version before 1.8 */ 2759 // For settings version before 1.9, DVDs and floppies are in hardware, not storage controllers, 2760 // so we shouldn't write them here; we only get here for DVDs though because we ruled out 2761 // the floppy controller at the top of the loop 2758 2762 if ( att.deviceType == DeviceType_DVD 2759 && m->sv <= SettingsVersion_v1_8) 2763 && m->sv < SettingsVersion_v1_9 2764 ) 2760 2765 continue; 2761 2766 … … 2863 2868 const StorageController &sctl = *it; 2864 2869 for (AttachedDevicesList::const_iterator it2 = sctl.llAttachedDevices.begin(); 2865 it2 != sctl.llAttachedDevices.end() 2866 && m->sv < SettingsVersion_v1_9; 2867 ++it2) 2868 { 2870 it2 != sctl.llAttachedDevices.end(); 2871 ++it2) 2872 { 2873 if (sctl.ulInstance != 0) // we can only write the StorageController/@Instance attribute with v1.9 2874 { 2875 m->sv = SettingsVersion_v1_9; 2876 break; 2877 } 2878 2869 2879 const AttachedDevice &att = *it2; 2870 2880 if (att.deviceType == DeviceType_DVD) … … 2886 2896 } 2887 2897 2888 // VirtualBox before 3.1 had exactlyone floppy and exactly one DVD,2898 // VirtualBox before 3.1 had zero or one floppy and exactly one DVD, 2889 2899 // so any deviation from that will require settings version 1.9 2890 2900 if ( (m->sv < SettingsVersion_v1_9)
Note:
See TracChangeset
for help on using the changeset viewer.

