--- ../qemu.cvs/block-part-raw.c Sun May 7 23:54:03 2006 +++ block-part-raw.c Mon May 8 00:40:32 2006 @@ -23,6 +23,7 @@ */ #include "vl.h" #include "block_int.h" +#include "bootsector.h" #ifdef __sun__ #include @@ -40,7 +41,7 @@ return 0; } -static int part_raw_open(BlockDriverState *bs, const char *filename) +static int part_raw_open(BlockDriverState *bs, const char *nfilename) { BDRVPartRawState *s = bs->opaque; int fd; @@ -53,6 +54,7 @@ int rv; #endif int head, cylinder, sector; + const char * filename = &(nfilename[5]); fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE); if (fd < 0) { @@ -102,6 +104,7 @@ /* set up fake MBR */ memset(s->mbr_data, 0, 63*512); + memcpy(s->mbr_data, mbr_boot_sector, 512); /* first partition is bootable */ s->mbr_data[446] = 0x80; /* start head */