Changeset 31128 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Jul 26, 2010 7:08:45 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r31098 r31128 1622 1622 char *pszFormat = NULL; /**< The format backed to use for this image. */ 1623 1623 bool fReadOnly; /**< True if the media is read-only. */ 1624 bool fMaybeReadOnly; /**< True if the media may or may not be read-only. */ 1624 1625 bool fHonorZeroWrites; /**< True if zero blocks should be written. */ 1625 1626 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); … … 1701 1702 fValid = CFGMR3AreValuesValid(pCurNode, 1702 1703 "Format\0Path\0" 1703 "ReadOnly\0 TempReadOnly\0HonorZeroWrites\0"1704 "ReadOnly\0MaybeReadOnly\0TempReadOnly\0HonorZeroWrites\0" 1704 1705 "HostIPStack\0UseNewIo\0" 1705 1706 "SetupMerge\0MergeSource\0MergeTarget\0"); … … 1742 1743 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 1743 1744 N_("DrvVD: Configuration error: Querying \"ReadOnly\" as boolean failed")); 1745 break; 1746 } 1747 1748 rc = CFGMR3QueryBoolDef(pCurNode, "MaybeReadOnly", &fMaybeReadOnly, false); 1749 if (RT_FAILURE(rc)) 1750 { 1751 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 1752 N_("DrvVD: Configuration error: Querying \"MaybeReadOnly\" as boolean failed")); 1744 1753 break; 1745 1754 } … … 2014 2023 iLevel, pszName, 2015 2024 VDIsReadOnly(pThis->pDisk) ? "read-only" : "read-write")); 2016 if ( 2025 if ( VDIsReadOnly(pThis->pDisk) 2017 2026 && !fReadOnly 2027 && !fMaybeReadOnly 2018 2028 && !pThis->fTempReadOnly 2019 2029 && iLevel == 0) -
trunk/src/VBox/Devices/Storage/fdc.c
r28800 r31128 1280 1280 /* WRITE commands */ 1281 1281 #ifdef VBOX 1282 if (cur_drv->ro) 1283 { 1284 /* Handle readonly medium early, no need to do DMA, touch the 1285 * LED or attempt any writes. A real floppy doesn't attempt 1286 * to write to readonly media either. */ 1287 fdctrl_stop_transfer (fdctrl, 0x60, 0x00 | (cur_drv->ro << 1), 1288 0x00); 1289 goto transfer_error; 1290 } 1291 1282 1292 { 1283 1293 uint32_t written; … … 1288 1298 AssertMsgRC (rc2, ("DMAReadMemory -> %Rrc\n", rc2)); 1289 1299 } 1290 #else 1291 DMA_read_memory (nchan, fdctrl->fifo + rel_pos, 1292 fdctrl->data_pos, len); 1293 #endif 1294 /* cpu_physical_memory_read(addr + fdctrl->data_pos, */ 1295 /* fdctrl->fifo + rel_pos, len); */ 1296 #ifndef VBOX 1297 if (bdrv_write(cur_drv->bs, fd_sector(cur_drv), 1298 fdctrl->fifo, 1) < 0) { 1299 FLOPPY_ERROR("writting sector %d\n", fd_sector(cur_drv)); 1300 fdctrl_stop_transfer(fdctrl, 0x60, 0x00, 0x00); 1301 goto transfer_error; 1302 } 1303 #else /* VBOX */ 1300 1304 1301 cur_drv->Led.Asserted.s.fWriting 1305 1302 = cur_drv->Led.Actual.s.fWriting = 1; … … 1315 1312 1316 1313 if (RT_FAILURE (rc)) { 1317 AssertMsgFailed (("Floppy: error writing sector %d. rc=%Rrc", 1318 fd_sector (cur_drv), rc)); 1319 fdctrl_stop_transfer (fdctrl, 0x60, 0x00, 0x00); 1314 AssertMsgFailed(("Floppy: error writing sector %d. rc=%Rrc", 1315 fd_sector (cur_drv), rc)); 1316 fdctrl_stop_transfer (fdctrl, 0x60, 0x00 | (cur_drv->ro << 1), 1317 0x00); 1318 goto transfer_error; 1319 } 1320 #else 1321 DMA_read_memory (nchan, fdctrl->fifo + rel_pos, 1322 fdctrl->data_pos, len); 1323 /* cpu_physical_memory_read(addr + fdctrl->data_pos, */ 1324 /* fdctrl->fifo + rel_pos, len); */ 1325 if (bdrv_write(cur_drv->bs, fd_sector(cur_drv), 1326 fdctrl->fifo, 1) < 0) { 1327 FLOPPY_ERROR("writting sector %d\n", fd_sector(cur_drv)); 1328 fdctrl_stop_transfer(fdctrl, 0x60, 0x00, 0x00); 1320 1329 goto transfer_error; 1321 1330 }
Note:
See TracChangeset
for help on using the changeset viewer.