- Timestamp:
- May 10, 2012 1:56:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r41236 r41237 171 171 172 172 if (!fSilent) 173 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(pszFilenameOrUuid).raw(), 174 enmDevType, AccessMode_ReadWrite, 175 /* fForceNewUuidOnOpen */ false, 176 pMedium.asOutParam())); 173 CHECK_ERROR(a->virtualBox, FindMedium(Bstr(pszFilenameOrUuid).raw(), 174 enmDevType, pMedium.asOutParam())); 177 175 else 178 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 179 enmDevType, AccessMode_ReadWrite, 180 /* fForceNewUuidOnOpen */ false, 181 pMedium.asOutParam()); 176 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), 177 enmDevType, pMedium.asOutParam()); 182 178 return rc; 183 179 } … … 204 200 } 205 201 206 rc = a->virtualBox->OpenMedium(Bstr(pszFilenameOrUuid).raw(), 207 enmDevType, AccessMode_ReadWrite, 208 /* fForceNewUuidOnOpen */ false, 202 rc = a->virtualBox->FindMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, 209 203 pMedium.asOutParam()); 210 204 /* If the medium is unknown try to open it. */ … … 238 232 return E_FAIL; 239 233 } 240 pszFilename = szFilenameAbs; 241 CHECK_ERROR(a->virtualBox, OpenMedium(Bstr(pszFilename).raw(), 242 DeviceType_Network, 243 AccessMode_ReadWrite, 244 /* fForceNewUuidOnOpen */ false, 245 pMedium.asOutParam())); 246 }else{ 247 248 CHECK_ERROR(a->virtualBox, CreateHardDisk(Bstr(pszFormat).raw(), 249 Bstr(pszFilename).raw(), 250 pMedium.asOutParam())); 251 } 234 pszFilename = szFilenameAbs; 235 } 236 237 CHECK_ERROR(a->virtualBox, CreateHardDisk(Bstr(pszFormat).raw(), 238 Bstr(pszFilename).raw(), 239 pMedium.asOutParam())); 252 240 return rc; 253 241 } … … 509 497 FilenameOrUuid = ValueUnion.psz; 510 498 else 511 return errorSyntax(USAGE_ MODIFYHD, "Invalid parameter '%s'", ValueUnion.psz);499 return errorSyntax(USAGE_CREATEHD, "Invalid parameter '%s'", ValueUnion.psz); 512 500 break; 513 501
Note:
See TracChangeset
for help on using the changeset viewer.