ParallelsHDDCore.cpp revision ee00a0b29854e7f513198772bccb6650f6dd2184
2N/A * available from http://www.virtualbox.org. This file is free software;
2N/Atypedef struct ParallelsHeader
2N/Atypedef struct PARALLELSIMAGE
2N/A const char *pszFilename;
2N/A unsigned uOpenFlags;
2N/A unsigned uImageFlags;
bool fAllocationBitmapChanged;
const char *pszFormat, ...)
return rc;
return rc;
cbRead);
void *pvCompleteUser)
void *pvCompleteUser)
void *pvCompleteUser)
return VINF_SUCCESS;
NULL);
return rc;
return rc;
if (pImage)
if (!fDelete)
return rc;
goto out;
goto out;
goto out;
goto out;
uint64_t cCylinders = pImage->cbSize / (512 * pImage->PCHSGeometry.cSectors * pImage->PCHSGeometry.cHeads);
goto out;
goto out;
pImage->pAllocationBitmap = (uint32_t *)RTMemAllocZ((uint32_t)pImage->cAllocationBitmapEntries * sizeof(uint32_t));
goto out;
NULL);
goto out;
out:
return rc;
int rc;
&pStorage);
return rc;
0, ¶llelsHeader,
char *pszExtension;
&cbFile);
return VERR_VD_PARALLELS_INVALID_HEADER;
return rc;
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
int rc;
goto out;
|| !*pszFilename)
goto out;
goto out;
if (!pImage)
goto out;
out:
return rc;
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p", pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
return rc;
if ( !pImage
|| !pszFilename
|| !*pszFilename)
goto out;
goto out;
goto out;
goto out;
out:
return rc;
int rc;
return rc;
LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbBuf=%zu pcbActuallyRead=%#p\n", pBackendData, uOffset, pvBuf, cbBuf, pcbActuallyRead));
if (pcbActuallyRead)
return rc;
LogFlowFunc(("pBackendData=%#p uOffset=%llu pvBuf=%#p cbBuf=%zu pcbWriteProcess=%#p\n", pBackendData, uOffset, pvBuf, cbBuf, pcbWriteProcess));
if (!pNewBlock)
goto out;
memcpy(pNewBlock + (uOffset - ((uint64_t)iIndexInAllocationTable * pImage->PCHSGeometry.cSectors * 512)),
NULL);
if (pcbWriteProcess)
*pcbPreRead = 0;
*pcbPostRead = 0;
out:
return rc;
int rc;
return rc;
if (pImage)
return PARALLELS_DISK_VERSION;
return cb;
return cb;
int rc;
if (pImage)
LogFlowFunc(("returns %Rrc (PCHS=%u/%u/%u)\n", rc, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
return rc;
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
int rc;
if (pImage)
goto out;
out:
return rc;
int rc;
if (pImage)
LogFlowFunc(("returns %Rrc (LCHS=%u/%u/%u)\n", rc, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
return rc;
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
int rc;
if (pImage)
goto out;
out:
return rc;
unsigned uImageFlags;
if (pImage)
uImageFlags = 0;
return uImageFlags;
unsigned uOpenFlags;
if (pImage)
uOpenFlags = 0;
return uOpenFlags;
int rc;
if (!pImage || (uOpenFlags & ~(VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_SHAREABLE | VD_OPEN_FLAGS_SEQUENTIAL)))
goto out;
out:
return rc;
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
out:
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
int rc;
if (pImage)
return rc;
if (pImage)
return rc;
if (pcbWriteProcess)
return VERR_VD_BLOCK_FREE;
if (pcbWriteProcess)
return rc;
return rc;
sizeof(VBOXHDDBACKEND),
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,