- Timestamp:
- Apr 6, 2020 6:06:54 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r83587 r83594 1985 1985 pHlp->pfnSSMGetU32(pSSM, &pThis->fResetting); 1986 1986 1987 pHlp->pfnSSMGetU32(pSSM, &pThis->cTargets); 1987 uint32_t cTargets; 1988 int rc = pHlp->pfnSSMGetU32(pSSM, &cTargets); 1989 AssertRCReturn(rc, rc); 1990 AssertReturn(cTargets == pThis->cTargets, 1991 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_LOAD_CONFIG_MISMATCH, RT_SRC_POS, 1992 N_("target count has changed: %u saved, %u configured now"), 1993 cTargets, pThis->cTargets)); 1988 1994 1989 1995 for (uint16_t uTarget = 0; uTarget < pThis->cTargets; uTarget++) 1990 1996 { 1991 1997 uint16_t cReqsRedo; 1992 pHlp->pfnSSMGetU16(pSSM, &cReqsRedo);1993 if (cReqsRedo >= VIRTQ_MAX_SIZE)1994 {1995 LogFunc(("Bad count of I/O transactions to re-do in SSM state data. Skipping\n"));1996 continue;1997 }1998 rc = pHlp->pfnSSMGetU16(pSSM, &cReqsRedo); 1999 AssertRCReturn(rc, rc); 2000 AssertReturn(cReqsRedo < VIRTQ_MAX_SIZE, 2001 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 2002 N_("Bad count of I/O transactions to re-do in saved state (%#x, max %#x - 1)"), 2003 cReqsRedo, VIRTQ_MAX_SIZE)); 1998 2004 1999 2005 for (uint16_t qIdx = VIRTQ_REQ_BASE; qIdx < VIRTIOSCSI_QUEUE_CNT; qIdx++) … … 2005 2011 for (int i = 0; i < cReqsRedo; i++) 2006 2012 { 2007 uint16_t qIdx, uHeadIdx; 2008 2009 pHlp->pfnSSMGetU16(pSSM, &qIdx); 2010 pHlp->pfnSSMGetU16(pSSM, &uHeadIdx); 2011 2012 if (qIdx >= VIRTIOSCSI_QUEUE_CNT) 2013 { 2014 LogFunc(("Bad queue index in SSM state data. Skipping\n")); 2015 continue; 2016 } 2017 if (uHeadIdx >= VIRTQ_MAX_SIZE) 2018 { 2019 LogFunc(("Bad queue elem index in SSM state data. Skipping\n")); 2020 continue; 2021 } 2013 uint16_t qIdx; 2014 rc = pHlp->pfnSSMGetU16(pSSM, &qIdx); 2015 AssertRCReturn(rc, rc); 2016 AssertReturn(qIdx < VIRTIOSCSI_QUEUE_CNT, 2017 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 2018 N_("Bad queue index for re-do in saved state (%#x, max %#x)"), 2019 qIdx, VIRTIOSCSI_QUEUE_CNT - 1)); 2020 2021 uint16_t idxHead; 2022 rc = pHlp->pfnSSMGetU16(pSSM, &idxHead); 2023 AssertRCReturn(rc, rc); 2024 AssertReturn(idxHead < VIRTQ_MAX_SIZE, 2025 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 2026 N_("Bad queue element index for re-do in saved state (%#x, max %#x)"), 2027 idxHead, VIRTQ_MAX_SIZE - 1)); 2028 2022 2029 PVIRTIOSCSIWORKERR3 pWorkerR3 = &pThisCC->aWorkers[qIdx]; 2023 pWorkerR3->auRedoDescs[pWorkerR3->cRedoDescs++] = uHeadIdx;2030 pWorkerR3->auRedoDescs[pWorkerR3->cRedoDescs++] = idxHead; 2024 2031 pWorkerR3->cRedoDescs %= VIRTQ_MAX_SIZE; 2025 2032 } … … 2029 2036 * Call the virtio core to let it load its state. 2030 2037 */ 2031 intrc = virtioCoreR3LoadExec(&pThis->Virtio, pDevIns->pHlpR3, pSSM);2038 rc = virtioCoreR3LoadExec(&pThis->Virtio, pDevIns->pHlpR3, pSSM); 2032 2039 2033 2040 /* … … 2039 2046 { 2040 2047 LogFunc(("Waking %s worker.\n", VIRTQNAME(qIdx))); 2041 rc= PDMDevHlpSUPSemEventSignal(pDevIns, pThis->aWorkers[qIdx].hEvtProcess);2042 AssertRCReturn(rc, rc );2048 int rc2 = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->aWorkers[qIdx].hEvtProcess); 2049 AssertRCReturn(rc, rc2); 2043 2050 } 2044 2051 } 2052 2045 2053 return rc; 2046 2054 }
Note:
See TracChangeset
for help on using the changeset viewer.