On Thu, Mar 08, 2012 at 02:11:33PM +0800, Zhi Hui Li wrote: > when I use the command : > > 1: mkdir /my_directory > > 2: qemu linux.img -fda fat:floppy:/my_directory > > when I write to the floppy(just "mkdir test.dir" in the floppy), > the error occur: > > "FLOPPY ERROR: fdctrl_transfer_handler: writing sector 1" > > and nothing is written to the /my_directory. > > I don't know why?
Although the error comes from hw/fdc.c code it's probably originates in block/vvfat.c:vvfat_write(), because fdc.c is calling bdrv_write() and reports an error if that function fails. I suggest adding printfs or using gdb. The only two returns that have no fprintf(stderr, ...) are: /* Check if we're operating in read-only mode */ if (s->qcow == NULL) { return -EACCES; } and if (sector_num < s->first_sectors_number) return -1; Perhaps one of these is failing? Stefan