summary refs log tree commit diff stats
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-10 11:12:28 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:30 +0200
commitf91cbefe2d0eb3f7b5071bcb1fd3a02970f1a776 (patch)
tree594406d70071e882dc5b273148a727bd5d206a07 /hw/scsi-disk.c
parent61a8d649ff1e125966b51d688ff43dc6ef6ca63b (diff)
downloadfocaccia-qemu-f91cbefe2d0eb3f7b5071bcb1fd3a02970f1a776.tar.gz
focaccia-qemu-f91cbefe2d0eb3f7b5071bcb1fd3a02970f1a776.zip
vvfat: Fix partition table
Unless parameter ":floppy:" is given, vvfat creates a virtual image
with DOS MBR defining a single partition which holds the FAT file
system.  The size of the virtual image depends on the width of the
FAT: 32 MiB (CHS 64, 16, 63) for 12 bit FAT, 504 MiB (CHS 1024, 16,
63) for 16 and 32 bit FAT, leaving (64*16-1)*63 = 64449 and
(1024*16-1)*64 = 1032129 sectors for the partition.

However, it screws up the end of the partition in the MBR:

    FAT width param.  start CHS  end CHS     start LBA  size
        :32:          0,1,1      1023,14,63       63    1032065
        :16:          0,1,1      1023,14,55       63    1032057
        :12:          0,1,1        63,14,55       63      64377

The actual FAT file system nevertheless assumes the partition has
1032129 or 64449 sectors.  Oops.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
0 files changed, 0 insertions, 0 deletions