儲存庫 vbox 的更動 65346
- 時間撮記:
- 2017-1-17 上午09:37:04 (8 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r64838 r65346 3368 3368 3369 3369 /** 3370 * Returns a string description of the given request state. 3371 * 3372 * @returns Pointer to the stringified state. 3373 * @param enmState The state. 3374 */ 3375 DECLINLINE(const char *) drvvdMediaExIoReqStateStringify(VDIOREQSTATE enmState) 3376 { 3377 #define STATE2STR(a_State) case VDIOREQSTATE_##a_State: return #a_State 3378 switch (enmState) 3379 { 3380 STATE2STR(INVALID); 3381 STATE2STR(FREE); 3382 STATE2STR(ALLOCATED); 3383 STATE2STR(ACTIVE); 3384 STATE2STR(SUSPENDED); 3385 STATE2STR(COMPLETING); 3386 STATE2STR(COMPLETED); 3387 STATE2STR(CANCELED); 3388 default: 3389 AssertMsgFailed(("Unknown state %u\n", enmState)); 3390 return "UNKNOWN"; 3391 } 3392 #undef STATE2STR 3393 } 3394 3395 3396 /** 3397 * Returns a string description of the given request type. 3398 * 3399 * @returns Pointer to the stringified type. 3400 * @param enmType The request type. 3401 */ 3402 DECLINLINE(const char *) drvvdMediaExIoReqTypeStringify(PDMMEDIAEXIOREQTYPE enmType) 3403 { 3404 #define TYPE2STR(a_Type) case PDMMEDIAEXIOREQTYPE_##a_Type: return #a_Type 3405 switch (enmType) 3406 { 3407 TYPE2STR(INVALID); 3408 TYPE2STR(FLUSH); 3409 TYPE2STR(WRITE); 3410 TYPE2STR(READ); 3411 TYPE2STR(DISCARD); 3412 TYPE2STR(SCSI); 3413 default: 3414 AssertMsgFailed(("Unknown type %u\n", enmType)); 3415 return "UNKNOWN"; 3416 } 3417 #undef TYPE2STR 3418 } 3419 3420 3421 /** 3422 * Dumps the interesting bits about the given I/O request to the release log. 3423 * 3424 * @returns nothing. 3425 * @param pThis VBox disk container instance data. 3426 * @param pIoReq The I/O request to dump. 3427 */ 3428 static void drvvdMediaExIoReqLogRel(PVBOXDISK pThis, PPDMMEDIAEXIOREQINT pIoReq) 3429 { 3430 uint64_t offStart = 0; 3431 size_t cbReq = 0; 3432 size_t cbLeft = 0; 3433 size_t cbBufSize = 0; 3434 uint64_t tsActive = RTTimeMilliTS() - pIoReq->tsSubmit; 3435 3436 if ( pIoReq->enmType == PDMMEDIAEXIOREQTYPE_READ 3437 || pIoReq->enmType == PDMMEDIAEXIOREQTYPE_WRITE) 3438 { 3439 offStart = pIoReq->ReadWrite.offStart; 3440 cbReq = pIoReq->ReadWrite.cbReq; 3441 cbLeft = pIoReq->ReadWrite.cbReqLeft; 3442 cbBufSize = pIoReq->ReadWrite.cbIoBuf; 3443 } 3444 3445 LogRel(("VD#%u: Request{%#p}:\n" 3446 " Type=%s State=%s Id=%#llx SubmitTs=%llu {%llu} Flags=%#x\n" 3447 " Offset=%llu Size=%zu Left=%zu BufSize=%zu\n", 3448 pThis->pDrvIns->iInstance, pIoReq, 3449 drvvdMediaExIoReqTypeStringify(pIoReq->enmType), 3450 drvvdMediaExIoReqStateStringify(pIoReq->enmState), 3451 pIoReq->uIoReqId, pIoReq->tsSubmit, tsActive, pIoReq->fFlags, 3452 offStart, cbReq, cbLeft, cbBufSize)); 3453 } 3454 3455 3456 /** 3370 3457 * Returns whether the VM is in a running state. 3371 3458 * … … 3416 3503 VDIOREQSTATE enmStateOld = (VDIOREQSTATE)ASMAtomicReadU32((volatile uint32_t *)&pIoReq->enmState); 3417 3504 3505 drvvdMediaExIoReqLogRel(pThis, pIoReq); 3506 3418 3507 /* 3419 3508 * We might have to try canceling the request multiple times if it transitioned from … … 3589 3678 PVBOXDISK pThis = RT_FROM_MEMBER(pInterface, VBOXDISK, IMediaEx); 3590 3679 3680 LogRel(("VD#%u: Cancelling all active requests\n", pThis->pDrvIns->iInstance)); 3681 3591 3682 for (unsigned idxBin = 0; idxBin < RT_ELEMENTS(pThis->aIoReqAllocBins); idxBin++) 3592 3683 { … … 3615 3706 PVBOXDISK pThis = RT_FROM_MEMBER(pInterface, VBOXDISK, IMediaEx); 3616 3707 unsigned idxBin = drvvdMediaExIoReqIdHash(uIoReqId); 3708 3709 LogRel(("VD#%u: Trying to cancel request %#llx\n", pThis->pDrvIns->iInstance, uIoReqId)); 3617 3710 3618 3711 int rc = RTSemFastMutexRequest(pThis->aIoReqAllocBins[idxBin].hMtxLstIoReqAlloc);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器