Index: block.c =================================================================== RCS file: /cvsroot/qemu/qemu/block.c,v retrieving revision 1.23 diff -u -p -r1.23 block.c --- block.c 30 Oct 2005 18:30:10 -0000 1.23 +++ block.c 25 Nov 2005 08:05:55 -0000 @@ -444,6 +444,10 @@ int bdrv_write(BlockDriverState *bs, int return -1; if (bs->read_only) return -1; + if (nb_sectors == 0) + return 0; + if (sector_num == 0 && bs->boot_sector_enabled) + memcpy(bs->boot_sector_data, buf, 512); return bs->drv->bdrv_write(bs, sector_num, buf, nb_sectors); }