Changeset 57064 in vbox for trunk/src/VBox
- Timestamp:
- Jul 23, 2015 4:22:04 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r56918 r57064 1502 1502 if (!pszPartitions) 1503 1503 { 1504 RawDescriptor. fRawDisk = true;1504 RawDescriptor.uFlags = VBOXHDDRAW_DISK; 1505 1505 RawDescriptor.pszRawDisk = rawdisk.c_str(); 1506 1506 } 1507 1507 else 1508 1508 { 1509 RawDescriptor. fRawDisk = false;1509 RawDescriptor.uFlags = VBOXHDDRAW_NORMAL; 1510 1510 RawDescriptor.pszRawDisk = NULL; 1511 1511 RawDescriptor.cPartDescs = 0; … … 1513 1513 1514 1514 uint32_t uPartitions = 0; 1515 uint32_t uPartitionsRO = 0; 1515 1516 1516 1517 const char *p = pszPartitions; … … 1527 1528 uPartitions |= RT_BIT(u32); 1528 1529 p = pszNext; 1530 if (*p == 'r') 1531 { 1532 uPartitionsRO |= RT_BIT(u32); 1533 p++; 1534 } 1529 1535 if (*p == ',') 1530 1536 p++; … … 1647 1653 if (uPartitions & RT_BIT(partitions.aPartitions[i].uIndex)) 1648 1654 { 1655 if (uPartitionsRO & RT_BIT(partitions.aPartitions[i].uIndex)) 1656 pPartDesc->uFlags |= VBOXHDDRAW_READONLY; 1657 1649 1658 if (fRelative) 1650 1659 { … … 1759 1768 1760 1769 #ifdef DEBUG_klaus 1761 if (! RawDescriptor.fRawDisk)1770 if (!(RawDescriptor.uFlags & VBOXHDDRAW_DISK)) 1762 1771 { 1763 1772 RTPrintf("# start length startoffset partdataptr device\n"); -
trunk/src/VBox/Storage/VMDK.cpp
r57007 r57064 3246 3246 case VMDKETYPE_HOSTED_SPARSE: 3247 3247 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, 3248 VDOpenFlagsToFileOpenFlags(uOpenFlags ,3248 VDOpenFlagsToFileOpenFlags(uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0, 3249 3249 false /* fCreate */)); 3250 3250 if (RT_FAILURE(rc)) … … 3273 3273 case VMDKETYPE_FLAT: 3274 3274 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, 3275 VDOpenFlagsToFileOpenFlags(uOpenFlags ,3275 VDOpenFlagsToFileOpenFlags(uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0, 3276 3276 false /* fCreate */)); 3277 3277 if (RT_FAILURE(rc)) … … 3365 3365 PVMDKEXTENT pExtent; 3366 3366 3367 if (pRaw-> fRawDisk)3367 if (pRaw->uFlags & VBOXHDDRAW_DISK) 3368 3368 { 3369 3369 /* Full raw disk access. This requires setting up a descriptor … … 3394 3394 pExtent->cNominalSectors = VMDK_BYTE2SECTOR(cbSize); 3395 3395 pExtent->uSectorOffset = 0; 3396 pExtent->enmAccess = VMDKACCESS_READWRITE;3396 pExtent->enmAccess = (pRaw->uFlags & VBOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE; 3397 3397 pExtent->fMetaDirty = false; 3398 3398 3399 3399 /* Open flat image, the raw disk. */ 3400 3400 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, 3401 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags & ~VD_OPEN_FLAGS_READONLY,3401 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0, 3402 3402 false /* fCreate */)); 3403 3403 if (RT_FAILURE(rc)) … … 3507 3507 /* Create partition table flat image. */ 3508 3508 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, 3509 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags ,3509 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0, 3510 3510 true /* fCreate */)); 3511 3511 if (RT_FAILURE(rc)) … … 3537 3537 pExtent->cNominalSectors = VMDK_BYTE2SECTOR(pPart->cbData); 3538 3538 pExtent->uSectorOffset = VMDK_BYTE2SECTOR(pPart->uStartOffset); 3539 pExtent->enmAccess = VMDKACCESS_READWRITE;3539 pExtent->enmAccess = (pPart->uFlags & VBOXHDDRAW_READONLY) ? VMDKACCESS_READONLY : VMDKACCESS_READWRITE; 3540 3540 pExtent->fMetaDirty = false; 3541 3541 3542 3542 /* Open flat image, the raw partition. */ 3543 3543 rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname, 3544 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags & ~VD_OPEN_FLAGS_READONLY,3544 VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0, 3545 3545 false /* fCreate */)); 3546 3546 if (RT_FAILURE(rc)) … … 3574 3574 3575 3575 rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType", 3576 pRaw->fRawDisk?3576 (pRaw->uFlags & VBOXHDDRAW_DISK) ? 3577 3577 "fullDevice" : "partitionedDevice"); 3578 3578 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.