diff -BurN qemu-snapshot-2006-03-27_23.orig/hw/pc.c qemu-snapshot-2006-03-27_23/hw/pc.c --- qemu-snapshot-2006-03-27_23.orig/hw/pc.c 2006-04-05 13:05:17.000000000 +0000 +++ qemu-snapshot-2006-03-27_23/hw/pc.c 2006-04-05 13:12:40.000000000 +0000 @@ -707,10 +707,6 @@ uint8_t bootsect[512]; uint8_t old_bootsect[512]; - if (bs_table[0] == NULL) { - fprintf(stderr, "A disk image must be given for 'hda' when booting a Linux kernel\n"); - exit(1); - } snprintf(buf, sizeof(buf), "%s/%s", bios_dir, LINUX_BOOT_FILENAME); ret = load_image(buf, bootsect); if (ret != sizeof(bootsect)) { @@ -719,12 +715,14 @@ exit(1); } - if (bdrv_read(bs_table[0], 0, old_bootsect, 1) >= 0) { - /* copy the MSDOS partition table */ - memcpy(bootsect + 0x1be, old_bootsect + 0x1be, 0x40); - } + if (bs_table[0]) { + if (bdrv_read(bs_table[0], 0, old_bootsect, 1) >= 0) { + /* copy the MSDOS partition table */ + memcpy(bootsect + 0x1be, old_bootsect + 0x1be, 0x40); + } - bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect)); + bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect)); + } /* now we can load the kernel */ ret = load_kernel(kernel_filename,