* [Qemu-devel] [PATCH] pc: boot sector writes and -kernel
@ 2005-11-25 8:25 Magnus Damm
0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2005-11-25 8:25 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
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
[-- Attachment #2: qemu-cvs_20051125-linux_boot_sector.patch --]
[-- Type: text/x-patch, Size: 603 bytes --]
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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-25 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-25 8:25 [Qemu-devel] [PATCH] pc: boot sector writes and -kernel Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).