Hello all,

When I try to run kvm with the following command line,

/usr/bin/qemu-system-x86_64 -m 1024 -kernel 
/kernels/git/kvm/arch/x86/boot/bzImage -append "root=/dev/sda" -drive 
file=f8.img,boot=on,if=virtio

I get an error saying 'A disk image must be given for 'hda' when booting a 
Linux kernel'

I traced it to the following piece of code in kvm-userspace/qemu/hw/pc.c

static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
..
...
hda = drive_get_index(IF_IDE, 0, 0);
    if (hda == -1) {
        fprintf(stderr, "A disk image must be given for 'hda' when booting "
                "a Linux kernel\n");
        exit(1);
    }

This function then proceeds to change the bootloader to boot the kernel 
directly.

Changing IF_IDE to IF_VIRTIO made kvm to run normally. So, i think we should 
not check for hda here, but for the boot disk.

I tried to fix it, but I could not figure out any clean way of obtaining the 
boot disk. Please help.
 
-- 
regards,

balaji rao
NITK

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to