Changeset 7689 in vbox for trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
- Timestamp:
- Apr 1, 2008 5:50:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r7652 r7689 849 849 { 850 850 LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename)); 851 int rc = VERR_NOT_IMPLEMENTED; 852 851 852 int rc = VINF_SUCCESS; 853 PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData; 854 855 /* Check arguments. */ 856 if ( !pImage 857 || !pszFilename 858 || !*pszFilename) 859 { 860 rc = VERR_INVALID_PARAMETER; 861 goto out; 862 } 863 864 /* Close the image. */ 865 vdiFreeImage(pImage, false); 866 867 /* Rename the file. */ 868 rc = RTFileMove(pImage->pszFilename, pszFilename, 0); 869 if (VBOX_FAILURE(rc)) 870 { 871 /* The move failed, try to reopen the original image. */ 872 int rc2 = vdiOpenImage(pImage, pImage->uOpenFlags); 873 if (VBOX_FAILURE(rc2)) 874 rc = rc2; 875 876 goto out; 877 } 878 879 /* Update pImage with the new information. */ 880 pImage->pszFilename = pszFilename; 881 882 /* Open the new image. */ 883 rc = vdiOpenImage(pImage, pImage->uOpenFlags); 884 if (VBOX_FAILURE(rc)) 885 goto out; 886 887 out: 853 888 LogFlowFunc(("returns %Vrc\n", rc)); 854 889 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.