Changeset 49585 in vbox
- Timestamp:
- Nov 20, 2013 1:55:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r49489 r49585 2962 2962 stack.fSessionOpen = false; 2963 2963 } 2964 catch(HRESULT /* aRC */)2964 catch(HRESULT aRC) 2965 2965 { 2966 com::ErrorInfo info(this, COM_IIDOF(IAppliance)); 2967 2966 2968 if (stack.fSessionOpen) 2967 2969 stack.pSession->UnlockMachine(); 2968 2970 2969 throw; 2971 if (info.isFullAvailable()) 2972 throw setError(aRC, Utf8Str(info.getText()).c_str()); 2973 else 2974 throw setError(aRC, "Unknown error during OVF import"); 2970 2975 } 2971 2976 } … … 3083 3088 } 3084 3089 if (itDiskImage == stack.mapDisks.end()) 3085 {3086 3090 throw setError(E_FAIL, 3087 3091 tr("Internal inconsistency looking up disk image '%s'. " 3088 3092 "Check compliance OVA package structure and file names " 3089 "references in the section <References> in the OVF file ."),3093 "references in the section <References> in the OVF file"), 3090 3094 availableImage.c_str()); 3091 }3092 3095 3093 3096 /* replace with a new found disk image */ … … 3113 3116 } 3114 3117 if (!vsdeTargetHD) 3115 {3116 3118 /* 3117 3119 * in this case it's an error because something wrong with OVF description file. … … 3121 3123 tr("Internal inconsistency looking up disk image '%s'"), 3122 3124 diCurrent.strHref.c_str()); 3123 }3124 3125 3125 3126 itVDisk = vsysThis.mapVirtualDisks.find(diCurrent.strDiskId); … … 3166 3167 ComPtr<IMachine> sMachine; 3167 3168 rc = stack.pSession->COMGETTER(Machine)(sMachine.asOutParam()); 3168 if (FAILED(rc)) throw rc; 3169 if (FAILED(rc)) 3170 throw rc; 3169 3171 3170 3172 // find the hard disk controller to which we should attach … … 3196 3198 dvdImage.asOutParam()); 3197 3199 3198 if (FAILED(rc)) throw rc; 3200 if (FAILED(rc)) 3201 throw rc; 3199 3202 3200 3203 rc = sMachine->AttachDevice(mhda.controllerType.raw(),// wstring name … … 3203 3206 DeviceType_DVD, // DeviceType_T type 3204 3207 dvdImage); 3205 if (FAILED(rc)) throw rc; 3208 if (FAILED(rc)) 3209 throw rc; 3206 3210 } 3207 3211 else … … 3213 3217 pTargetHD); 3214 3218 3215 if (FAILED(rc)) throw rc; 3219 if (FAILED(rc)) 3220 throw rc; 3216 3221 } 3217 3222 … … 3219 3224 3220 3225 rc = sMachine->SaveSettings(); 3221 if (FAILED(rc)) throw rc; 3226 if (FAILED(rc)) 3227 throw rc; 3222 3228 3223 3229 /* restore */ … … 3239 3245 // only now that we're done with all disks, close the session 3240 3246 rc = stack.pSession->UnlockMachine(); 3241 if (FAILED(rc)) throw rc; 3247 3248 if (FAILED(rc)) 3249 throw rc; 3250 3242 3251 stack.fSessionOpen = false; 3243 3252 } 3244 catch(HRESULT /* aRC */)3253 catch(HRESULT aRC) 3245 3254 { 3255 com::ErrorInfo info(this, COM_IIDOF(IAppliance)); 3256 3246 3257 if (stack.fSessionOpen) 3247 3258 stack.pSession->UnlockMachine(); 3248 3259 3249 throw; 3260 if (info.isFullAvailable()) 3261 throw setError(aRC, Utf8Str(info.getText()).c_str()); 3262 else 3263 throw setError(aRC, "Unknown error during OVF import"); 3250 3264 } 3251 3265 }
Note:
See TracChangeset
for help on using the changeset viewer.