Changeset 55871 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- May 15, 2015 7:50:49 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100327
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r55770 r55871 2330 2330 2331 2331 /** 2332 * @copydoc FNPDMDRVPOWEROFF 2333 */ 2334 static DECLCALLBACK(void) drvvdPowerOff(PPDMDRVINS pDrvIns) 2335 { 2336 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 2337 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 2338 LogFlowFunc(("\n")); 2339 2340 RTSEMFASTMUTEX mutex; 2341 ASMAtomicXchgHandle(&pThis->MergeCompleteMutex, NIL_RTSEMFASTMUTEX, &mutex); 2342 if (mutex != NIL_RTSEMFASTMUTEX) 2343 { 2344 /* Request the semaphore to wait until a potentially running merge 2345 * operation has been finished. */ 2346 int rc = RTSemFastMutexRequest(mutex); 2347 AssertRC(rc); 2348 pThis->fMergePending = false; 2349 rc = RTSemFastMutexRelease(mutex); 2350 AssertRC(rc); 2351 rc = RTSemFastMutexDestroy(mutex); 2352 AssertRC(rc); 2353 } 2354 2355 if (RT_VALID_PTR(pThis->pBlkCache)) 2356 { 2357 PDMR3BlkCacheRelease(pThis->pBlkCache); 2358 pThis->pBlkCache = NULL; 2359 } 2360 2361 if (RT_VALID_PTR(pThis->pDisk)) 2362 { 2363 VDDestroy(pThis->pDisk); 2364 pThis->pDisk = NULL; 2365 } 2366 drvvdFreeImages(pThis); 2367 } 2368 2369 /** 2332 2370 * VM resume notification that we use to undo what the temporary read-only image 2333 2371 * mode set by drvvdSuspend. … … 2432 2470 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 2433 2471 LogFlowFunc(("\n")); 2434 2435 RTSEMFASTMUTEX mutex;2436 ASMAtomicXchgHandle(&pThis->MergeCompleteMutex, NIL_RTSEMFASTMUTEX, &mutex);2437 if (mutex != NIL_RTSEMFASTMUTEX)2438 {2439 /* Request the semaphore to wait until a potentially running merge2440 * operation has been finished. */2441 int rc = RTSemFastMutexRequest(mutex);2442 AssertRC(rc);2443 pThis->fMergePending = false;2444 rc = RTSemFastMutexRelease(mutex);2445 AssertRC(rc);2446 rc = RTSemFastMutexDestroy(mutex);2447 AssertRC(rc);2448 }2449 2450 if (RT_VALID_PTR(pThis->pBlkCache))2451 {2452 PDMR3BlkCacheRelease(pThis->pBlkCache);2453 pThis->pBlkCache = NULL;2454 }2455 2456 if (RT_VALID_PTR(pThis->pDisk))2457 {2458 VDDestroy(pThis->pDisk);2459 pThis->pDisk = NULL;2460 }2461 drvvdFreeImages(pThis);2462 2472 2463 2473 if (pThis->MergeLock != NIL_RTSEMRW) … … 3318 3328 NULL, 3319 3329 /* pfnPowerOff */ 3320 NULL,3330 drvvdPowerOff, 3321 3331 /* pfnSoftReset */ 3322 3332 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.