Commit 69e5bc90688361772120a1199e7459b8b72a9998
1 parent
c8135d9a
generate read error if no image (win XP install boot)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@548 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
2 deletions
hw/fdc.c
... | ... | @@ -788,8 +788,12 @@ static int fdctrl_transfer_handler (uint32_t addr, int size, int *irq) |
788 | 788 | } |
789 | 789 | if (fdctrl.data_dir != FD_DIR_WRITE) { |
790 | 790 | /* READ & SCAN commands */ |
791 | - if (cur_drv->bs == NULL || | |
792 | - bdrv_read(cur_drv->bs, fd_sector(cur_drv), orig, 1) < 0) { | |
791 | + if (cur_drv->bs == NULL) { | |
792 | + fdctrl_stop_transfer(0x40, 0x00, 0x00); | |
793 | + goto transfer_error; | |
794 | + } | |
795 | + | |
796 | + if (bdrv_read(cur_drv->bs, fd_sector(cur_drv), orig, 1) < 0) { | |
793 | 797 | FLOPPY_DPRINTF("Floppy: error getting sector %d\n", |
794 | 798 | fd_sector(cur_drv)); |
795 | 799 | /* Sure, image size is too small... */ | ... | ... |