- Timestamp:
- Aug 14, 2008 6:23:31 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34787
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxHDD-new.h
r11421 r11435 280 280 * 281 281 * @return Pointer to the matching interface or NULL if none was found. 282 * @param p Interfaces Pointer to the first interface in the list.282 * @param pVDIfs Pointer to the VD interface list. 283 283 * @param enmInterface Interface to search for. 284 284 */ 285 DECLINLINE(PVDINTERFACE) VD GetInterfaceFromList(PVDINTERFACE pInterfaces, VDINTERFACETYPE enmInterface)285 DECLINLINE(PVDINTERFACE) VDInterfaceGet(PVDINTERFACE pVDIfs, VDINTERFACETYPE enmInterface) 286 286 { 287 287 AssertMsgReturn( (enmInterface >= VDINTERFACETYPE_FIRST) … … 289 289 ("enmInterface=%u", enmInterface), NULL); 290 290 291 while (p Interfaces)291 while (pVDIfs) 292 292 { 293 293 /* Sanity checks. */ 294 AssertMsgBreak(p Interfaces->cbSize == sizeof(VDINTERFACE),295 ("cbSize=%u\n", p Interfaces->cbSize));294 AssertMsgBreak(pVDIfs->cbSize == sizeof(VDINTERFACE), 295 ("cbSize=%u\n", pVDIfs->cbSize)); 296 296 297 if (p Interfaces->enmInterface == enmInterface)298 return p Interfaces;299 p Interfaces = pInterfaces->pNext;297 if (pVDIfs->enmInterface == enmInterface) 298 return pVDIfs; 299 pVDIfs = pVDIfs->pNext; 300 300 } 301 301 … … 305 305 306 306 /** 307 * Initialize a common interface structure.307 * Add an interface to a list of interfaces. 308 308 * 309 309 * @return VBox status code. … … 313 313 * @param pCallbacks The callback table of the interface. 314 314 * @param pvUser Opaque user data passed on every function call. 315 * @param p Next Pointer to the next supported interface if any.316 */ 317 DECLINLINE(int) VDInterface Create(PVDINTERFACE pInterface, const char *pszName,318 319 void *pvUser, PVDINTERFACE pNext)315 * @param ppVDIfs Pointer to the VD interface list. 316 */ 317 DECLINLINE(int) VDInterfaceAdd(PVDINTERFACE pInterface, const char *pszName, 318 VDINTERFACETYPE enmInterface, void *pCallbacks, 319 void *pvUser, PVDINTERFACE *ppVDIfs) 320 320 { 321 321 … … 329 329 VERR_INVALID_PARAMETER); 330 330 331 AssertMsgReturn(VALID_PTR(ppVDIfs), 332 ("pInterfaceList=%#p", ppVDIfs), 333 VERR_INVALID_PARAMETER); 334 335 /* Fill out interface descriptor. */ 331 336 pInterface->cbSize = sizeof(VDINTERFACE); 332 337 pInterface->pszInterfaceName = pszName; … … 334 339 pInterface->pCallbacks = pCallbacks; 335 340 pInterface->pvUser = pvUser; 336 pInterface->pNext = pNext; 341 pInterface->pNext = *ppVDIfs; 342 343 /* Remember the new start of the list. */ 344 *ppVDIfs = pInterface; 345 337 346 return VINF_SUCCESS; 338 347 } … … 893 902 * 894 903 * @return VBox status code. 895 * @param p Interfaces Pointer to the first supported interface.904 * @param pVDIfs Pointer to the VD interface list. 896 905 * @param ppDisk Where to store the reference to HDD container. 897 906 */ 898 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE p Interfaces, PVBOXHDD *ppDisk);907 VBOXDDU_DECL(int) VDCreate(PVDINTERFACE pVDIfs, PVBOXHDD *ppDisk); 899 908 900 909 /** -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r11287 r11435 89 89 /** Flag whether suspend has changed image open mode to read only. */ 90 90 bool fTempReadOnly; 91 /** Pointer to list of VD interfaces. */ 92 PVDINTERFACE pVDIfs; 91 93 /** Common structure for the supported error interface. */ 92 94 VDINTERFACE VDIError; … … 535 537 536 538 /* Initialize supported VD interfaces. */ 539 pThis->pVDIfs = NULL; 540 537 541 pThis->VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 538 542 pThis->VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 539 543 pThis->VDIErrorCallbacks.pfnError = drvvdErrorCallback; 540 544 541 rc = VDInterface Create(&pThis->VDIError, "DrvVD_VDIError", VDINTERFACETYPE_ERROR,542 &pThis->VDIErrorCallbacks, pDrvIns, NULL);545 rc = VDInterfaceAdd(&pThis->VDIError, "DrvVD_VDIError", VDINTERFACETYPE_ERROR, 546 &pThis->VDIErrorCallbacks, pDrvIns, &pThis->pVDIfs); 543 547 AssertRC(rc); 544 548 … … 554 558 pThis->VDIAsyncIOCallbacks.pfnTasksSubmit = drvvdAsyncIOTasksSubmit; 555 559 556 rc = VDInterface Create(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO,557 &pThis->VDIAsyncIOCallbacks, pThis, &pThis->VDIError);560 rc = VDInterfaceAdd(&pThis->VDIAsyncIO, "DrvVD_AsyncIO", VDINTERFACETYPE_ASYNCIO, 561 &pThis->VDIAsyncIOCallbacks, pThis, &pThis->pVDIfs); 558 562 AssertRC(rc); 559 563 … … 573 577 * At the moment this is harmless, as iSCSI can only be used as a base 574 578 * image, and no other backend uses the private data for these callbacks. */ 575 rc = VDInterface Create(&pThis->VDIConfig, "DrvVD_Config", VDINTERFACETYPE_CONFIG,576 &pThis->VDIConfigCallbacks, NULL /**< @todo TEMP */, &pThis->VDIAsyncIO);579 rc = VDInterfaceAdd(&pThis->VDIConfig, "DrvVD_Config", VDINTERFACETYPE_CONFIG, 580 &pThis->VDIConfigCallbacks, NULL /**< @todo TEMP */, &pThis->pVDIfs); 577 581 AssertRC(rc); 578 582 -
trunk/src/VBox/Devices/Storage/RawHDDCore.cpp
r11421 r11435 47 47 RTFILE File; 48 48 49 /** Pointer to list of VD interfaces. */ 50 PVDINTERFACE pVDIfs; 49 51 /** Error callback. */ 50 52 PVDINTERFACE pInterfaceError; … … 116 118 pImage->uOpenFlags = uOpenFlags; 117 119 120 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 121 if (pImage->pInterfaceError) 122 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 123 118 124 /* 119 125 * Open the image. … … 176 182 pImage->LCHSGeometry = *pLCHSGeometry; 177 183 184 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 185 if (pImage->pInterfaceError) 186 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 187 178 188 /* Create image file. */ 179 189 rc = RTFileOpen(&File, pImage->pszFilename, … … 320 330 /** @copydoc VBOXHDDBACKEND::pfnOpen */ 321 331 static int rawOpen(const char *pszFilename, unsigned uOpenFlags, 322 PVDINTERFACE p Interfaces, void **ppBackendData)332 PVDINTERFACE pVDIfs, void **ppBackendData) 323 333 { 324 334 LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x ppBackendData=%#p\n", pszFilename, uOpenFlags, ppBackendData)); … … 352 362 pImage->pInterfaceError = NULL; 353 363 pImage->pInterfaceErrorCallbacks = NULL; 354 355 pImage->pInterfaceError = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR); 356 if (pImage->pInterfaceError) 357 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 364 pImage->pVDIfs = pVDIfs; 358 365 359 366 rc = rawOpenImage(pImage, uOpenFlags); … … 374 381 unsigned uOpenFlags, PFNVMPROGRESS pfnProgress, 375 382 void *pvUser, unsigned uPercentStart, 376 unsigned uPercentSpan, PVDINTERFACE p Interfaces,383 unsigned uPercentSpan, PVDINTERFACE pVDIfs, 377 384 void **ppBackendData) 378 385 { 379 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u p Interfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));386 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pVDIfs=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pVDIfs, ppBackendData)); 380 387 int rc; 381 388 PRAWIMAGE pImage; … … 407 414 pImage->pszFilename = pszFilename; 408 415 pImage->File = NIL_RTFILE; 409 410 pImage->pInterfaceError = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR); 411 if (pImage->pInterfaceError) 412 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 413 416 pImage->pVDIfs = pVDIfs; 414 417 415 418 rc = rawCreateImage(pImage, enmType, cbSize, uImageFlags, pszComment, -
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r11421 r11435 819 819 pDisk->pInterfaceErrorCallbacks = NULL; 820 820 821 pDisk->pInterfaceError = VD GetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR);821 pDisk->pInterfaceError = VDInterfaceGet(pInterfaces, VDINTERFACETYPE_ERROR); 822 822 if (pDisk->pInterfaceError) 823 823 pDisk->pInterfaceErrorCallbacks = VDGetInterfaceError(pDisk->pInterfaceError); -
trunk/src/VBox/Devices/Storage/VDICore.h
r10781 r11435 579 579 /** Physical geometry of this image (never actually stored). */ 580 580 PDMMEDIAGEOMETRY PCHSGeometry; 581 /** Pointer to list of VD interfaces. */ 582 PVDINTERFACE pVDIfs; 581 583 /** Error interface. */ 582 584 PVDINTERFACE pInterfaceError; -
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r11421 r11435 347 347 Assert(VALID_PTR(pLCHSGeometry)); 348 348 349 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 350 if (pImage->pInterfaceError) 351 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 352 349 353 vdiInitPreHeader(&pImage->PreHeader); 350 354 vdiInitHeader(&pImage->Header, enmType, uImageFlags, pszComment, cbSize, VDI_IMAGE_DEFAULT_BLOCK_SIZE, 0); … … 528 532 529 533 pImage->uOpenFlags = uOpenFlags; 534 535 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 536 if (pImage->pInterfaceError) 537 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 530 538 531 539 /* … … 751 759 pImage->pInterfaceError = NULL; 752 760 pImage->pInterfaceErrorCallbacks = NULL; 761 pImage->pVDIfs = NULL; 753 762 754 763 rc = vdiOpenImage(pImage, VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_READONLY); … … 762 771 /** @copydoc VBOXHDDBACKEND::pfnOpen */ 763 772 static int vdiOpen(const char *pszFilename, unsigned uOpenFlags, 764 PVDINTERFACE pInterfaces, 765 void **ppBackendData) 773 PVDINTERFACE pVDIfs, void **ppBackendData) 766 774 { 767 775 LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x ppBackendData=%#p\n", pszFilename, uOpenFlags, ppBackendData)); … … 795 803 pImage->pInterfaceError = NULL; 796 804 pImage->pInterfaceErrorCallbacks = NULL; 797 798 pImage->pInterfaceError = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR); 799 if (pImage->pInterfaceError) 800 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 805 pImage->pVDIfs = pVDIfs; 801 806 802 807 rc = vdiOpenImage(pImage, uOpenFlags); … … 817 822 unsigned uOpenFlags, PFNVMPROGRESS pfnProgress, 818 823 void *pvUser, unsigned uPercentStart, 819 unsigned uPercentSpan, PVDINTERFACE p Interfaces,824 unsigned uPercentSpan, PVDINTERFACE pVDIfs, 820 825 void **ppBackendData) 821 826 { 822 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u p Interfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));827 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pVDIfs=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pVDIfs, ppBackendData)); 823 828 int rc; 824 829 PVDIIMAGEDESC pImage; … … 855 860 pImage->pInterfaceError = NULL; 856 861 pImage->pInterfaceErrorCallbacks = NULL; 862 pImage->pVDIfs = pVDIfs; 857 863 858 864 rc = vdiCreateImage(pImage, enmType, cbSize, uImageFlags, pszComment, -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r11421 r11435 359 359 PVMDKFILE pFile; 360 360 361 /** Pointer to list of VD interfaces. */ 362 PVDINTERFACE pVDIfs; 363 361 364 /** Error interface. */ 362 365 PVDINTERFACE pInterfaceError; … … 2326 2329 pImage->uOpenFlags = uOpenFlags; 2327 2330 2331 /* Try to get error interface. */ 2332 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 2333 if (pImage->pInterfaceError) 2334 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 2335 2336 /* Try to get async I/O interface. */ 2337 pImage->pInterfaceAsyncIO = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ASYNCIO); 2338 if (pImage->pInterfaceAsyncIO) 2339 pImage->pInterfaceAsyncIOCallbacks = VDGetInterfaceAsyncIO(pImage->pInterfaceAsyncIO); 2340 2328 2341 /* 2329 2342 * Open the image. … … 3113 3126 3114 3127 pImage->uImageFlags = uImageFlags; 3128 3129 /* Try to get error interface. */ 3130 pImage->pInterfaceError = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ERROR); 3131 if (pImage->pInterfaceError) 3132 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 3133 3134 /* Try to get async I/O interface. */ 3135 pImage->pInterfaceAsyncIO = VDInterfaceGet(pImage->pVDIfs, VDINTERFACETYPE_ASYNCIO); 3136 if (pImage->pInterfaceAsyncIO) 3137 pImage->pInterfaceAsyncIOCallbacks = VDGetInterfaceAsyncIO(pImage->pInterfaceAsyncIO); 3138 3115 3139 rc = vmdkCreateDescriptor(pImage, pImage->pDescData, pImage->cbDescAlloc, 3116 3140 &pImage->Descriptor); … … 3678 3702 pImage->pInterfaceError = NULL; 3679 3703 pImage->pInterfaceErrorCallbacks = NULL; 3704 pImage->pInterfaceAsyncIO = NULL; 3705 pImage->pInterfaceAsyncIOCallbacks = NULL; 3706 pImage->pVDIfs = NULL; 3680 3707 /** @todo speed up this test open (VD_OPEN_FLAGS_INFO) by skipping as 3681 3708 * much as possible in vmdkOpenImage. */ … … 3690 3717 /** @copydoc VBOXHDDBACKEND::pfnOpen */ 3691 3718 static int vmdkOpen(const char *pszFilename, unsigned uOpenFlags, 3692 PVDINTERFACE pInterfaces, 3693 void **ppBackendData) 3719 PVDINTERFACE pVDIfs, void **ppBackendData) 3694 3720 { 3695 3721 LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x ppBackendData=%#p\n", pszFilename, uOpenFlags, ppBackendData)); … … 3728 3754 pImage->pInterfaceError = NULL; 3729 3755 pImage->pInterfaceErrorCallbacks = NULL; 3730 3731 /* Try to get error interface. */ 3732 pImage->pInterfaceError = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR); 3733 if (pImage->pInterfaceError) 3734 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError); 3735 3736 /* Try to get async I/O interface. */ 3737 pImage->pInterfaceAsyncIO = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ASYNCIO); 3738 if (pImage->pInterfaceAsyncIO) 3739 pImage->pInterfaceAsyncIOCallbacks = VDGetInterfaceAsyncIO(pImage->pInterfaceAsyncIO); 3740 3756 pImage->pInterfaceAsyncIO = NULL; 3757 pImage->pInterfaceAsyncIOCallbacks = NULL; 3758 pImage->pVDIfs = NULL; 3741 3759 3742 3760 rc = vmdkOpenImage(pImage, uOpenFlags); … … 3757 3775 unsigned uOpenFlags, PFNVMPROGRESS pfnProgress, 3758 3776 void *pvUser, unsigned uPercentStart, 3759 unsigned uPercentSpan, PVDINTERFACE p Interfaces,3777 unsigned uPercentSpan, PVDINTERFACE pVDIfs, 3760 3778 void **ppBackendData) 3761 3779 { 3762 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u p Interfaces=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pInterfaces, ppBackendData));3780 LogFlowFunc(("pszFilename=\"%s\" enmType=%d cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x pfnProgress=%#p pvUser=%#p uPercentStart=%u uPercentSpan=%u pVDIfs=%#p ppBackendData=%#p", pszFilename, enmType, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, pfnProgress, pvUser, uPercentStart, uPercentSpan, pVDIfs, ppBackendData)); 3763 3781 int rc; 3764 3782 PVMDKIMAGE pImage; … … 3801 3819 pImage->pInterfaceError = NULL; 3802 3820 pImage->pInterfaceErrorCallbacks = NULL; 3821 pImage->pInterfaceAsyncIO = NULL; 3822 pImage->pInterfaceAsyncIOCallbacks = NULL; 3823 pImage->pVDIfs = NULL; 3803 3824 pImage->cbDescAlloc = VMDK_SECTOR2BYTE(20); 3804 3825 pImage->pDescData = (char *)RTMemAllocZ(pImage->cbDescAlloc); … … 3808 3829 goto out; 3809 3830 } 3810 3811 /* Get error interface. */3812 pImage->pInterfaceError = VDGetInterfaceFromList(pInterfaces, VDINTERFACETYPE_ERROR);3813 if (pImage->pInterfaceError)3814 pImage->pInterfaceErrorCallbacks = VDGetInterfaceError(pImage->pInterfaceError);3815 3831 3816 3832 rc = vmdkCreateImage(pImage, enmType, cbSize, uImageFlags, pszComment, -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r11353 r11435 56 56 PDMMEDIAGEOMETRY PCHS = { 0, 0, 0 }; 57 57 PDMMEDIAGEOMETRY LCHS = { 0, 0, 0 }; 58 PVDINTERFACE pVDIfs = NULL; 58 59 VDINTERFACE VDIError; 59 60 VDINTERFACEERROR VDIErrorCallbacks; … … 75 76 VDIErrorCallbacks.pfnError = tstVDError; 76 77 77 rc = VDInterface Create(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks,78 NULL, NULL);78 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 79 NULL, &pVDIfs); 79 80 AssertRC(rc); 80 81 … … 431 432 uint64_t u64DiskSize = 1000 * _1M; 432 433 uint32_t u32SectorSize = 512; 434 PVDINTERFACE pVDIfs = NULL; 433 435 VDINTERFACE VDIError; 434 436 VDINTERFACEERROR VDIErrorCallbacks; … … 450 452 VDIErrorCallbacks.pfnError = tstVDError; 451 453 452 rc = VDInterface Create(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks,453 NULL, NULL);454 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 455 NULL, &pVDIfs); 454 456 AssertRC(rc); 455 457 … … 549 551 uint64_t u64DiskSize = 1000 * _1M; 550 552 uint32_t u32SectorSize = 512; 553 PVDINTERFACE pVDIfs; 551 554 VDINTERFACE VDIError; 552 555 VDINTERFACEERROR VDIErrorCallbacks; … … 568 571 VDIErrorCallbacks.pfnError = tstVDError; 569 572 570 rc = VDInterface Create(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks,571 NULL, NULL);573 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 574 NULL, &pVDIfs); 572 575 AssertRC(rc); 573 576 -
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r11353 r11435 749 749 HOSTPARTITIONS partitions; 750 750 uint32_t uPartitions = 0; 751 PVDINTERFACE pVDIfs = NULL; 751 752 752 753 /* let's have a closer look at the arguments */ … … 1150 1151 vdInterfaceErrorCallbacks.pfnError = handleVDError; 1151 1152 1152 vrc = VDInterface Create(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR,1153 &vdInterfaceErrorCallbacks, NULL, NULL);1153 vrc = VDInterfaceAdd(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR, 1154 &vdInterfaceErrorCallbacks, NULL, &pVDIfs); 1154 1155 AssertRC(vrc); 1155 1156 … … 1257 1258 PVBOXHDD pDisk = NULL; 1258 1259 1260 PVDINTERFACE pVDIfs = NULL; 1259 1261 VDINTERFACE vdInterfaceError; 1260 1262 VDINTERFACEERROR vdInterfaceErrorCallbacks; … … 1263 1265 vdInterfaceErrorCallbacks.pfnError = handleVDError; 1264 1266 1265 int vrc = VDInterface Create(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR,1266 &vdInterfaceErrorCallbacks, NULL, NULL);1267 int vrc = VDInterfaceAdd(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR, 1268 &vdInterfaceErrorCallbacks, NULL, &pVDIfs); 1267 1269 AssertRC(vrc); 1268 1270 … … 1337 1339 PVBOXHDD pDisk = NULL; 1338 1340 1341 PVDINTERFACE pVDIfs = NULL; 1339 1342 VDINTERFACE vdInterfaceError; 1340 1343 VDINTERFACEERROR vdInterfaceErrorCallbacks; … … 1343 1346 vdInterfaceErrorCallbacks.pfnError = handleVDError; 1344 1347 1345 int vrc = VDInterface Create(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR,1346 &vdInterfaceErrorCallbacks, NULL, NULL);1348 int vrc = VDInterfaceAdd(&vdInterfaceError, "VBoxManage_IError", VDINTERFACETYPE_ERROR, 1349 &vdInterfaceErrorCallbacks, NULL, &pVDIfs); 1347 1350 AssertRC(vrc); 1348 1351 -
trunk/src/VBox/Main/HardDiskImpl.cpp
r10752 r11435 3404 3404 3405 3405 /* Create supported error interface. */ 3406 mVDInterfaces = NULL; 3406 3407 mInterfaceErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 3407 3408 mInterfaceErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 3408 3409 mInterfaceErrorCallbacks.pfnError = VDError; 3409 int vrc = VDInterface Create(&mInterfaceError, "VMDK_IError", VDINTERFACETYPE_ERROR,3410 &mInterfaceErrorCallbacks, this, NULL);3410 int vrc = VDInterfaceAdd(&mInterfaceError, "VMDK_IError", VDINTERFACETYPE_ERROR, 3411 &mInterfaceErrorCallbacks, this, &mVDInterfaces); 3411 3412 ComAssertRCRet (vrc, E_FAIL); 3412 3413 … … 4292 4293 4293 4294 /* Create supported error interface. */ 4295 mVDInterfaces = NULL; 4294 4296 mInterfaceErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 4295 4297 mInterfaceErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 4296 4298 mInterfaceErrorCallbacks.pfnError = VDError; 4297 int vrc = VDInterface Create(&mInterfaceError, "Custom_IError", VDINTERFACETYPE_ERROR,4298 &mInterfaceErrorCallbacks, this, NULL);4299 int vrc = VDInterfaceAdd(&mInterfaceError, "Custom_IError", VDINTERFACETYPE_ERROR, 4300 &mInterfaceErrorCallbacks, this, &mVDInterfaces); 4299 4301 ComAssertRCRet (vrc, E_FAIL); 4300 4302 … … 5138 5140 5139 5141 /* Create supported error interface. */ 5142 mVDInterfaces = NULL; 5140 5143 mInterfaceErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 5141 5144 mInterfaceErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 5142 5145 mInterfaceErrorCallbacks.pfnError = VDError; 5143 int vrc = VDInterface Create(&mInterfaceError, "VHD_IError", VDINTERFACETYPE_ERROR,5144 &mInterfaceErrorCallbacks, this, NULL);5146 int vrc = VDInterfaceAdd(&mInterfaceError, "VHD_IError", VDINTERFACETYPE_ERROR, 5147 &mInterfaceErrorCallbacks, this, &mVDInterfaces); 5145 5148 ComAssertRCRet (vrc, E_FAIL); 5146 5149 -
trunk/src/VBox/Main/include/HardDiskImpl.h
r10715 r11435 539 539 PVBOXHDD mContainer; 540 540 541 PVDINTERFACE mVDInterfaces; 542 541 543 VDINTERFACE mInterfaceError; 542 544 VDINTERFACEERROR mInterfaceErrorCallbacks; … … 654 656 PVBOXHDD mContainer; 655 657 658 PVDINTERFACE mVDInterfaces; 659 656 660 VDINTERFACE mInterfaceError; 657 661 VDINTERFACEERROR mInterfaceErrorCallbacks; … … 770 774 PVBOXHDD mContainer; 771 775 776 PVDINTERFACE mVDInterfaces; 777 772 778 VDINTERFACE mInterfaceError; 773 779 VDINTERFACEERROR mInterfaceErrorCallbacks;
Note:
See TracChangeset
for help on using the changeset viewer.