Commit 79639d423f779e65f24d0fcc05b14d6c45b4a894
1 parent
9332f9da
update boot sector when using -kernel (Magnus Damm)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1664 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
3 additions
and
0 deletions
block.c
@@ -444,6 +444,9 @@ int bdrv_write(BlockDriverState *bs, int64_t sector_num, | @@ -444,6 +444,9 @@ int bdrv_write(BlockDriverState *bs, int64_t sector_num, | ||
444 | return -1; | 444 | return -1; |
445 | if (bs->read_only) | 445 | if (bs->read_only) |
446 | return -1; | 446 | return -1; |
447 | + if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { | ||
448 | + memcpy(bs->boot_sector_data, buf, 512); | ||
449 | + } | ||
447 | return bs->drv->bdrv_write(bs, sector_num, buf, nb_sectors); | 450 | return bs->drv->bdrv_write(bs, sector_num, buf, nb_sectors); |
448 | } | 451 | } |
449 | 452 |