From: Balaji Rao Subject: problem booting linux kernel directly with virtio Date: Thu, 21 Feb 2008 22:36:39 +0530 Message-ID: <200802212236.39078.balajirrao@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel@lists.sourceforge.net Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org 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/