Changeset 2918 in vbox for trunk/src/VBox
- Timestamp:
- May 29, 2007 2:26:58 PM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r2643 r2918 4877 4877 if (strcmp(argv[0], "disk") == 0) 4878 4878 { 4879 const char *type = "normal";4879 const char *type = NULL; 4880 4880 /* there can be a type parameter */ 4881 4881 if ((argc > 2) && (argc != 4)) … … 4898 4898 } 4899 4899 4900 ComPtr<IVirtualDiskImage> vdi; 4901 4902 CHECK_ERROR(virtualBox, OpenVirtualDiskImage(filepath, vdi.asOutParam())); 4903 if (SUCCEEDED(rc) && vdi) 4904 { 4905 ComPtr<IHardDisk> hardDisk = vdi; 4900 ComPtr<IHardDisk> hardDisk; 4901 CHECK_ERROR(virtualBox, OpenHardDisk(filepath, hardDisk.asOutParam())); 4902 if (SUCCEEDED(rc) && hardDisk) 4903 { 4906 4904 /* change the type if requested */ 4907 if (strcmp(type, "normal") == 0) 4908 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_NormalHardDisk)); 4909 else if (strcmp(type, "immutable") == 0) 4910 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_ImmutableHardDisk)); 4911 else if (strcmp(type, "writethrough") == 0) 4912 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_WritethroughHardDisk)); 4913 CHECK_ERROR(virtualBox, RegisterHardDisk(hardDisk)); 4905 if (type) 4906 { 4907 if (strcmp(type, "normal") == 0) 4908 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_NormalHardDisk)); 4909 else if (strcmp(type, "immutable") == 0) 4910 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_ImmutableHardDisk)); 4911 else if (strcmp(type, "writethrough") == 0) 4912 CHECK_ERROR(hardDisk, COMSETTER(Type)(HardDiskType_WritethroughHardDisk)); 4913 } 4914 if (SUCCEEDED(rc)) 4915 CHECK_ERROR(virtualBox, RegisterHardDisk(hardDisk)); 4914 4916 } 4915 4917 } -
trunk/src/VBox/Main/HardDiskImpl.cpp
r2358 r2918 251 251 tr ("You cannot change the type of the registered hard disk '%ls'"), 252 252 toString().raw()); 253 254 /* return silently if nothing to do */ 255 if (mType == aType) 256 return S_OK; 257 258 if (mStorageType == HardDiskStorageType_VMDKImage) 259 return setError (E_FAIL, 260 tr ("Currently, changing the type of VMDK hard disks is not allowed")); 253 261 254 262 if (mStorageType == HardDiskStorageType_ISCSIHardDisk)
Note:
See TracChangeset
for help on using the changeset viewer.