From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EfYtg-0004re-VA for qemu-devel@nongnu.org; Fri, 25 Nov 2005 03:25:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EfYtZ-0004qI-KU for qemu-devel@nongnu.org; Fri, 25 Nov 2005 03:25:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EfYtV-0004pz-CF for qemu-devel@nongnu.org; Fri, 25 Nov 2005 03:25:22 -0500 Received: from [64.233.162.194] (helo=zproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EfYtU-0008ID-L8 for qemu-devel@nongnu.org; Fri, 25 Nov 2005 03:25:21 -0500 Received: by zproxy.gmail.com with SMTP id r28so1708521nza for ; Fri, 25 Nov 2005 00:25:17 -0800 (PST) Message-ID: Date: Fri, 25 Nov 2005 17:25:17 +0900 From: Magnus Damm MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_10723_24870786.1132907117112" Subject: [Qemu-devel] [PATCH] pc: boot sector writes and -kernel Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_10723_24870786.1132907117112 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 ------=_Part_10723_24870786.1132907117112 Content-Type: text/x-patch; name=qemu-cvs_20051125-linux_boot_sector.patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qemu-cvs_20051125-linux_boot_sector.patch" 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); } ------=_Part_10723_24870786.1132907117112--