Hello there,

This patch adds write support to the overlapping boot sector used by
the -kernel command line option.

Without the patch, guests booted with -kernel will fail updating boot
sector. This results in a fdisk that is unable to update the partition
table in the running kernel, but is able to write the correct boot
sector to disk.

Please apply.

/ magnus
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);
 }
 



_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to