Changeset 32943 in vbox
- Timestamp:
- Oct 6, 2010 1:42:59 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Storage/DevATA.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r32108 r32943 1436 1436 int rc; 1437 1437 LogRel(("PIIX3 ATA: Host disk full\n")); 1438 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_DISKFULL",1438 rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevATA_DISKFULL", 1439 1439 N_("Host system reported disk full. VM execution is suspended. You can resume after freeing some space")); 1440 1440 AssertRC(rc); … … 1445 1445 int rc; 1446 1446 LogRel(("PIIX3 ATA: File too big\n")); 1447 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_FILETOOBIG",1447 rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevATA_FILETOOBIG", 1448 1448 N_("Host system reported that the file size limit of the host file system has been exceeded. VM execution is suspended. You need to move your virtual hard disk to a filesystem which allows bigger files")); 1449 1449 AssertRC(rc); … … 1454 1454 int rc; 1455 1455 LogRel(("PIIX3 ATA: iSCSI target unavailable\n")); 1456 rc = PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "DevATA_ISCSIDOWN",1456 rc = PDMDevHlpVMSetRuntimeError(pDevIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DevATA_ISCSIDOWN", 1457 1457 N_("The iSCSI target has stopped responding. VM execution is suspended. You can resume when it is available again")); 1458 1458 AssertRC(rc); 1459 1459 } 1460 1460 1461 /** 1462 * Suspend I/O operations on a controller. Also suspends EMT, because it's 1463 * waiting for I/O to make progress. The next attempt to perform an I/O 1464 * operation will be made when EMT is resumed up again (as the resume 1465 * callback below restarts I/O). 1466 * 1467 * @param pCtl Controller for which to suspend I/O. 1468 */ 1469 static void ataSuspendRedo(PATACONTROLLER pCtl) 1470 { 1471 PPDMDEVINS pDevIns = CONTROLLER_2_DEVINS(pCtl); 1472 int rc; 1473 1474 pCtl->fRedoIdle = true; 1475 rc = VMR3ReqCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 1476 (PFNRT)PDMDevHlpVMSuspend, 1, pDevIns); 1477 AssertReleaseRC(rc); 1478 } 1479 1480 bool ataIsRedoSetWarning(ATADevState *s, int rc) 1461 static bool ataIsRedoSetWarning(ATADevState *s, int rc) 1481 1462 { 1482 1463 PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s); … … 1484 1465 if (rc == VERR_DISK_FULL) 1485 1466 { 1467 pCtl->fRedoIdle = true; 1486 1468 ataWarningDiskFull(ATADEVSTATE_2_DEVINS(s)); 1487 ataSuspendRedo(pCtl);1488 1469 return true; 1489 1470 } 1490 1471 if (rc == VERR_FILE_TOO_BIG) 1491 1472 { 1473 pCtl->fRedoIdle = true; 1492 1474 ataWarningFileTooBig(ATADEVSTATE_2_DEVINS(s)); 1493 ataSuspendRedo(pCtl);1494 1475 return true; 1495 1476 } 1496 1477 if (rc == VERR_BROKEN_PIPE || rc == VERR_NET_CONNECTION_REFUSED) 1497 1478 { 1479 pCtl->fRedoIdle = true; 1498 1480 /* iSCSI connection abort (first error) or failure to reestablish 1499 1481 * connection (second error). Pause VM. On resume we'll retry. */ 1500 1482 ataWarningISCSI(ATADEVSTATE_2_DEVINS(s)); 1501 ataSuspendRedo(pCtl);1502 1483 return true; 1503 1484 } … … 1506 1487 1507 1488 1508 static int ataReadSectors(ATADevState *s, uint64_t u64Sector, void *pvBuf, uint32_t cSectors, bool *fRedo) 1489 static int ataReadSectors(ATADevState *s, uint64_t u64Sector, void *pvBuf, 1490 uint32_t cSectors, bool *pfRedo) 1509 1491 { 1510 1492 PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s); … … 1522 1504 1523 1505 if (RT_SUCCESS(rc)) 1524 * fRedo = false;1506 *pfRedo = false; 1525 1507 else 1526 * fRedo = ataIsRedoSetWarning(s, rc);1508 *pfRedo = ataIsRedoSetWarning(s, rc); 1527 1509 1528 1510 STAM_PROFILE_START(&pCtl->StatLockWait, a); … … 1533 1515 1534 1516 1535 static int ataWriteSectors(ATADevState *s, uint64_t u64Sector, const void *pvBuf, uint32_t cSectors, bool *fRedo) 1517 static int ataWriteSectors(ATADevState *s, uint64_t u64Sector, 1518 const void *pvBuf, uint32_t cSectors, bool *pfRedo) 1536 1519 { 1537 1520 PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s); … … 1557 1540 1558 1541 if (RT_SUCCESS(rc)) 1559 * fRedo = false;1542 *pfRedo = false; 1560 1543 else 1561 * fRedo = ataIsRedoSetWarning(s, rc);1544 *pfRedo = ataIsRedoSetWarning(s, rc); 1562 1545 1563 1546 STAM_PROFILE_START(&pCtl->StatLockWait, a); … … 4923 4906 LogRel(("PIIX3 ATA: Ctl#%d: redo PIO operation\n", ATACONTROLLER_IDX(pCtl))); 4924 4907 ataAsyncIOPutRequest(pCtl, &g_ataPIORequest); 4925 ataSuspendRedo(pCtl);4926 4908 break; 4927 4909 } … … 5681 5663 ASMAtomicWriteU32(&pThis->aCts[i].fShutdown, true); 5682 5664 rc = RTSemEventSignal(pThis->aCts[i].AsyncIOSem); 5665 AssertRC(rc); 5666 rc = RTSemEventSignal(pThis->aCts[i].SuspendIOSem); 5683 5667 AssertRC(rc); 5684 5668 }
Note:
See TracChangeset
for help on using the changeset viewer.

