Changeset 56967 in vbox for trunk/src/VBox
- Timestamp:
- Jul 17, 2015 1:07:09 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r56945 r56967 195 195 endif 196 196 197 ifn1of ($(KBUILD_TARGET), darwin) 198 VBoxDD_SOURCES += Storage/HBDMgmt-generic.cpp 199 endif 200 201 VBoxDD_SOURCES.darwin += Storage/HBDMgmt-darwin.cpp 202 197 203 VBoxDD_LIBS = # more later. 198 204 VBoxDD_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDD.dylib \ -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r55964 r56967 52 52 #endif /* VBOX_WITH_INIP */ 53 53 54 #include "HBDMgmt.h" 55 54 56 #include "VBoxDD.h" 55 57 … … 187 189 /** The block cache handle if configured. */ 188 190 PPDMBLKCACHE pBlkCache; 191 /** Host block device manager. */ 192 HBDMGR hHbdMgr; 189 193 190 194 /** Cryptographic support … … 350 354 { 351 355 PVBOXDISK pThis = (PVBOXDISK)pvUser; 352 PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)RTMemAllocZ(sizeof(DRVVDSTORAGEBACKEND));356 PDRVVDSTORAGEBACKEND pStorageBackend = NULL; 353 357 int rc = VINF_SUCCESS; 354 358 359 /* 360 * Check whether the backend wants to open a block device and try to prepare it 361 * if we didn't claim it yet. 362 * 363 * We only create a block device manager on demand to not waste any resources. 364 */ 365 if (HBDMgrIsBlockDevice(pszLocation)) 366 { 367 if (pThis->hHbdMgr == NIL_HBDMGR) 368 rc = HBDMgrCreate(&pThis->hHbdMgr); 369 370 if ( RT_SUCCESS(rc) 371 && !HBDMgrIsBlockDeviceClaimed(pThis->hHbdMgr, pszLocation)) 372 rc = HBDMgrClaimBlockDevice(pThis->hHbdMgr, pszLocation); 373 374 if (RT_FAILURE(rc)) 375 return rc; 376 } 377 378 pStorageBackend = (PDRVVDSTORAGEBACKEND)RTMemAllocZ(sizeof(DRVVDSTORAGEBACKEND)); 355 379 if (pStorageBackend) 356 380 { … … 415 439 PDRVVDSTORAGEBACKEND pStorageBackend = (PDRVVDSTORAGEBACKEND)pStorage; 416 440 441 /* 442 * We don't unclaim any block devices on purpose here because they 443 * might get reopened shortly (switching to readonly during suspend) 444 * 445 * Block devices will get unclaimed during destruction of the driver. 446 */ 447 417 448 PDMR3AsyncCompletionEpClose(pStorageBackend->pEndpoint); 418 449 PDMR3AsyncCompletionTemplateDestroy(pStorageBackend->pTemplate); 419 450 RTSemEventDestroy(pStorageBackend->EventSem); 420 451 RTMemFree(pStorageBackend); 421 422 452 return VINF_SUCCESS;; 423 453 } … … 2504 2534 pThis->pszBwGroup = NULL; 2505 2535 } 2536 if (pThis->hHbdMgr != NIL_HBDMGR) 2537 HBDMgrDestroy(pThis->hHbdMgr); 2506 2538 } 2507 2539
Note:
See TracChangeset
for help on using the changeset viewer.