- Timestamp:
- Jun 18, 2013 10:36:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r46581 r46615 2686 2686 ovf::DiskImage diCurrent = oit->second; 2687 2687 ovf::VirtualDisksMap::const_iterator itVDisk = vsysThis.mapVirtualDisks.begin(); 2688 bool fFoundInCurrentPosition = false;2689 2688 2690 2689 VirtualSystemDescriptionEntry *vsdeTargetHD = 0; … … 2735 2734 if (strncmp(pStorage->pVDImageIfaces->pszInterfaceName, name.c_str(), name.length()) == 0) 2736 2735 { 2736 /* It means that we possibly have imported the storage earlier on the previous loop steps*/ 2737 std::set<RTCString>::const_iterator h = disksResolvedNames.find(diCurrent.strHref); 2738 if (h != disksResolvedNames.end()) 2739 { 2740 /* Yes, disk name was found, we can skip it*/ 2741 ++oit; 2742 continue; 2743 } 2744 2737 2745 RTCString availableImage(diCurrent.strHref); 2738 2746 … … 2746 2754 if(availableImage.compare(diCurrent.strHref, Utf8Str::CaseInsensitive) != 0) 2747 2755 { 2748 2749 if (RTPathHaveExt(availableImage.c_str()))2750 {2751 /* Figure out which format the user have. */2752 char *pszExt = RTPathExt(availableImage.c_str());2753 /* Get the system properties. */2754 SystemProperties *pSysProps = mVirtualBox->getSystemProperties();2755 ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension(&pszExt[1]);2756 if (trgFormat.isNull())2757 {2758 ++oit;2759 continue;2760 }2761 }2762 2763 2756 /* 2764 2757 * … … 2819 2812 else 2820 2813 { 2821 fFoundInCurrentPosition = true;2822 2814 ++oit; 2823 2815 } … … 2832 2824 { 2833 2825 /* just continue with normal files*/ 2834 fFoundInCurrentPosition = true;2835 2826 ++oit; 2836 }2837 2838 /* It means that we possibly have imported the storage earlier on the previous loop steps*/2839 if (!fFoundInCurrentPosition)2840 {2841 std::set<RTCString>::const_iterator h = disksResolvedNames.find(diCurrent.strHref);2842 if (h != disksResolvedNames.end())2843 {2844 /* Yes, disk name was found, we can skip it*/2845 continue;2846 }2847 2827 } 2848 2828 … … 3140 3120 while(oit != stack.mapDisks.end()) 3141 3121 { 3142 if (RTPathHaveExt(oit-> first.c_str()))3122 if (RTPathHaveExt(oit->second.strHref.c_str())) 3143 3123 { 3144 3124 /* Figure out which format the user have. */ … … 3155 3135 3156 3136 ovf::DiskImage diCurrent = oit->second; 3157 bool fFoundInCurrentPosition = false;3158 3137 3159 3138 VirtualSystemDescriptionEntry *vsdeTargetHD = 0; … … 3192 3171 if (strncmp(pStorage->pVDImageIfaces->pszInterfaceName, name.c_str(), name.length()) == 0) 3193 3172 { 3173 /* It means that we possibly have imported the storage earlier on the previous loop steps*/ 3174 std::set<RTCString>::const_iterator h = disksResolvedNames.find(diCurrent.strHref); 3175 if (h != disksResolvedNames.end()) 3176 { 3177 /* Yes, disk name was found, we can skip it*/ 3178 ++oit; 3179 continue; 3180 } 3181 3194 3182 RTCString availableImage(diCurrent.strHref); 3195 3183 … … 3203 3191 if(availableImage.compare(diCurrent.strHref, Utf8Str::CaseInsensitive) != 0) 3204 3192 { 3205 if (RTPathHaveExt(availableImage.c_str()))3206 {3207 /* Figure out which format the user have. */3208 char *pszExt = RTPathExt(availableImage.c_str());3209 /* Get the system properties. */3210 SystemProperties *pSysProps = mVirtualBox->getSystemProperties();3211 ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension(&pszExt[1]);3212 if (trgFormat.isNull())3213 {3214 ++oit;3215 continue;3216 }3217 }3218 3219 3193 // availableImage contains the disk identifier (e.g. "vmdisk1"), which should exist 3220 3194 // in the virtual system's disks map under that ID and also in the global images map … … 3258 3232 else 3259 3233 { 3260 fFoundInCurrentPosition = true;3261 3234 ++oit; 3262 3235 } … … 3271 3244 { 3272 3245 /* just continue with normal files*/ 3273 fFoundInCurrentPosition = true;3274 3246 ++oit; 3275 }3276 3277 /* It means that we possibly have imported the storage earlier on the previous loop steps*/3278 if (!fFoundInCurrentPosition)3279 {3280 std::set<RTCString>::const_iterator h = disksResolvedNames.find(diCurrent.strHref);3281 if (h != disksResolvedNames.end())3282 {3283 /* Yes, disk name was found, we can skip it*/3284 continue;3285 }3286 3247 } 3287 3248
Note:
See TracChangeset
for help on using the changeset viewer.