Changeset 15591 in vbox for trunk/src/VBox
- Timestamp:
- Dec 16, 2008 2:46:08 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r15577 r15591 1420 1420 * @param pszComment Pointer to image comment. NULL is ok. 1421 1421 * @param pUuid New UUID of the image. If NULL, a new UUID is created. 1422 * @param pParentUuid New parent UUID of the image. If NULL, the UUID is queried automatically. 1422 1423 * @param uOpenFlags Image file open mode, see VD_OPEN_FLAGS_* constants. 1423 1424 * @param pVDIfsImage Pointer to the per-image VD interface list. … … 1427 1428 const char *pszFilename, unsigned uImageFlags, 1428 1429 const char *pszComment, PCRTUUID pUuid, 1429 unsigned uOpenFlags, PVDINTERFACE pVDIfsImage, 1430 PCRTUUID pParentUuid, unsigned uOpenFlags, 1431 PVDINTERFACE pVDIfsImage, 1430 1432 PVDINTERFACE pVDIfsOperation) 1431 1433 { … … 1434 1436 RTUUID uuid; 1435 1437 1436 LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" uImageFlags=%#x pszComment=\"%s\" Uuid=%RTuuid uOpenFlags=%#x pVDIfsImage=%#p pVDIfsOperation=%#p\n",1437 pDisk, pszBackend, pszFilename, uImageFlags, pszComment, pUuid, uOpenFlags,1438 LogFlowFunc(("pDisk=%#p pszBackend=\"%s\" pszFilename=\"%s\" uImageFlags=%#x pszComment=\"%s\" Uuid=%RTuuid ParentUuid=%RTuuid uOpenFlags=%#x pVDIfsImage=%#p pVDIfsOperation=%#p\n", 1439 pDisk, pszBackend, pszFilename, uImageFlags, pszComment, pUuid, pParentUuid, uOpenFlags, 1438 1440 pVDIfsImage, pVDIfsOperation)); 1439 1441 … … 1463 1465 AssertMsgBreakStmt(pUuid == NULL || VALID_PTR(pUuid), 1464 1466 ("pUuid=%#p UUID=%RTuuid\n", pUuid, pUuid), 1467 rc = VERR_INVALID_PARAMETER); 1468 /* The parent UUID may be NULL. */ 1469 AssertMsgBreakStmt(pParentUuid == NULL || VALID_PTR(pParentUuid), 1470 ("pParentUuid=%#p ParentUUID=%RTuuid\n", pParentUuid, pParentUuid), 1465 1471 rc = VERR_INVALID_PARAMETER); 1466 1472 AssertMsgBreakStmt((uOpenFlags & ~VD_OPEN_FLAGS_MASK) == 0, … … 1544 1550 int rc2; 1545 1551 1546 rc2 = pDisk->pLast->Backend->pfnGetUuid(pDisk->pLast->pvBackendData,1547 &Uuid);1548 if (RT_SUCCESS(rc2))1552 if (pParentUuid && !RTUuidIsNull(pParentUuid)) 1553 { 1554 Uuid = *pParentUuid; 1549 1555 pImage->Backend->pfnSetParentUuid(pImage->pvBackendData, &Uuid); 1556 } 1557 else 1558 { 1559 rc2 = pDisk->pLast->Backend->pfnGetUuid(pDisk->pLast->pvBackendData, 1560 &Uuid); 1561 if (RT_SUCCESS(rc2)) 1562 pImage->Backend->pfnSetParentUuid(pImage->pvBackendData, &Uuid); 1563 } 1550 1564 rc2 = pDisk->pLast->Backend->pfnGetModificationUuid(pDisk->pLast->pvBackendData, 1551 1565 &Uuid); … … 1554 1568 &Uuid); 1555 1569 rc2 = pDisk->pLast->Backend->pfnGetTimeStamp(pDisk->pLast->pvBackendData, 1556 1570 &ts); 1557 1571 if (RT_SUCCESS(rc2)) 1558 1572 pImage->Backend->pfnSetParentTimeStamp(pImage->pvBackendData, &ts); … … 2000 2014 { 2001 2015 rc = VDCreateDiff(pDiskTo, pszBackend, pszFilename, uImageFlagsFrom, 2002 szComment, &ImageUuid, uOpenFlagsFrom & ~VD_OPEN_FLAGS_READONLY, NULL, NULL);2016 szComment, &ImageUuid, &ParentUuid, uOpenFlagsFrom & ~VD_OPEN_FLAGS_READONLY, NULL, NULL); 2003 2017 } else { 2004 2018 rc = VDCreateBase(pDiskTo, pszBackend, pszFilename, enmTypeFrom, … … 2008 2022 if (RT_SUCCESS(rc) && !RTUuidIsNull(&ImageUuid)) 2009 2023 pDiskTo->pLast->Backend->pfnSetUuid(pDiskTo->pLast->pvBackendData, &ImageUuid); 2024 if (RT_SUCCESS(rc) && !RTUuidIsNull(&ParentUuid)) 2025 pDiskTo->pLast->Backend->pfnSetParentUuid(pDiskTo->pLast->pvBackendData, &ParentUuid); 2010 2026 } 2011 2027 if (RT_FAILURE(rc)) … … 2065 2081 { 2066 2082 pImageTo->Backend->pfnSetModificationUuid(pImageTo->pvBackendData, &ImageModificationUuid); 2067 pImageTo->Backend->pfnGetParentUuid(pImageTo->pvBackendData, &ParentUuid);2068 2083 pImageTo->Backend->pfnGetParentModificationUuid(pImageTo->pvBackendData, &ParentModificationUuid); 2069 2084 } -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r15529 r15591 582 582 583 583 rc = VDCreateDiff(pVD, pszBackend, pszDiffFilename, 584 VD_IMAGE_FLAGS_NONE, "Test diff image", NULL, 584 VD_IMAGE_FLAGS_NONE, "Test diff image", NULL, NULL, 585 585 VD_OPEN_FLAGS_NORMAL, NULL, NULL); 586 586 CHECK("VDCreateDiff()"); -
trunk/src/VBox/Main/HardDisk2Impl.cpp
r15568 r15591 3371 3371 3372 3372 /* The object may request a specific UUID (through a special form of 3373 * the setLocation() argume t). Otherwise we have to generate it */3373 * the setLocation() argument). Otherwise we have to generate it */ 3374 3374 Guid targetId = target->m.id; 3375 3375 bool generateUuid = targetId.isEmpty(); … … 3426 3426 VD_IMAGE_FLAGS_NONE, 3427 3427 NULL, targetId.raw(), 3428 NULL /******/, 3428 3429 VD_OPEN_FLAGS_NORMAL, 3429 3430 target->mm.vdDiskIfaces,
Note:
See TracChangeset
for help on using the changeset viewer.