qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Minoru Usui <usui@mxm.nes.nec.co.jp>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Boot order problem
Date: Sun, 24 Jul 2011 09:30:49 +0300	[thread overview]
Message-ID: <20110724063049.GM3044@redhat.com> (raw)
In-Reply-To: <20110722095116.56bf87c5.usui@mxm.nes.nec.co.jp>

On Fri, Jul 22, 2011 at 09:51:16AM +0900, Minoru Usui wrote:
> Hi, everyone
> 
> I'm in trouble about boot order of VM.
> If anyone know cause of this problem, please let me know.
> 
The cause of the "problem" is the design. booindex and -boot only
modifies the order in which bios will search for bootable device.
It does not exclude devices from a boot device list.
 
> On following environment, I tried to boot from IDE CD-ROM device 
> without inserting any bootable media, which is expected to fail,
> but VM was booting up from virtio HDD which was not specified as bootable device.
> 
>   * host : RHEL6.1(x86_64)
>     guest: RHEL6.1(x86_64)
>   * VM has IDE CD-ROM and virtio HDD.
>   * There is no bootable media in IDE CD-ROM.
>   * RHEL6.1 is installed in virtio HDD
>   * Only IDE CD-ROM was spcified as bootable device.
>   * XML configuration of libvirt is below.
>     I tested <boot dev> and <boot order> setting,
>     but both are booting up from virtio HDD.
>     -------------------------------------------------------
>     [<boot dev> setting version]
>       <os>
>         <type arch='x86_64' machine='rhel6.1.0'>hvm</type>
>         <boot dev='cdrom'/>
>         <bootmenu enable='no'/>
>       </os>
> 
>     [<boot order> setting version]
>        <disk type='file' device='cdrom'>
>          <driver name='qemu' type='raw'/>
>          <target dev='hdc' bus='ide'/>
>          <boot order='1'/>
>          <readonly/>
>          <address type='drive' controller='0' bus='1' unit='0'/>
>        </disk>
>     -------------------------------------------------------
> 
> I installed latest qemu-kvm to /usr/local/qemu, and replaced
> /usr/libexec/qemu-kvm to /user/local/qemu/bin/qemu-system-x86_64,
> but it was booting up from virtio HDD.
> 
> On RHEL6.0 host, I tested <boot dev> setting version, 
> VM didn't boot up from virtio HDD.
> it cannot boot up from CD-ROM. (expected behaviour)
> 
This is not expected behaviour. Expected behaviour is VM boots from HDD.
The only way I can explain behaviour you describe above is that the bios
you are using for RHEL6.0 rpm does not support booting from virtio HDD.
You can test this but making HDD to be ide and retry your test.

> I checked qemu-kvm option by ps command,
> but I think correct -boot or bootindex of -device option is specified.
> 
> [<boot dev> setting version(RHEL6.1 host)]
> qemu      9871     1 74 16:22 ?        00:00:25 /usr/libexec/qemu-kvm -S -M rhel6.1.0 -enable-kvm -m 2048
>  -smp 8,sockets=8,cores=1,threads=1 -name RHEL6.1-GA -uuid 49703959-f0b0-9864-5788-4bc07028bac4 -nodefconfig
>  -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/RHEL6.1-GA.monitor,server,nowait 
>  -mon chardev=charmonitor,id=monitor,mode=readline -rtc base=utc -boot order=d,menu=off
>  -drive file=/work/libvirt/images/RHEL6.1GA_x86_64_full_file.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=threads
>  -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0
>  -drive file=/tmp/not_bootable_image.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
>  -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:0b:68:82,bus=pci.0,addr=0x3 -net tap,fd=21,vlan=0,name=hostnet0
>  -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0
>  -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4
>  -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
> 
>   -> "-boot order=d" is specified
> 
> 
> [<boot order> setting version(RHEL6.1 host)]
> qemu      4073     1 23 10:08 ?        00:00:37 /usr/libexec/qemu-kvm -S -M rhel6.1.0 -enable-kvm -m 2048
>  -smp 8,sockets=8,cores=1,threads=1 -name RHEL6.1-GA -uuid 49703959-f0b0-9864-5788-4bc07028bac4 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/RHEL6.1-GA.monitor,server,nowait
>  -mon chardev=charmonitor,id=monitor,mode=readline -rtc base=utc -drive file=/work/libvirt/images/RHEL6.1GA_x86_64_full_file.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=threads
>  -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0
>  -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw
>  -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1
>  -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:0b:68:82,bus=pci.0,addr=0x3 -net tap,fd=21,vlan=0,name=hostnet0
>  -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0
>  -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4
>  -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
> 
>   -> "bootindex=1" is specified for IDE CD-ROM device only.
> 
> 
> Next, I suspected seabios, but it was same version of RHEL6.0 and RHEL6.1.
> 
>   # rpm -q seabios
>   seabios-0.6.1.2-3.el6.x86_64
> 
This bios supports booting from virtio and when I do the same test as
you, qemu boots from virtio HDD. Try to reinstall seabios rpm.

> What causes this problem?
> -- 
> Minoru Usui <usui@mxm.nes.nec.co.jp>

--
			Gleb.

  reply	other threads:[~2011-07-24  6:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22  0:51 [Qemu-devel] Boot order problem Minoru Usui
2011-07-24  6:30 ` Gleb Natapov [this message]
2011-07-25  7:07   ` Minoru Usui
2011-07-25  9:06     ` Gleb Natapov
2011-07-26  1:07       ` Minoru Usui
2011-07-25  7:44   ` Minoru Usui
2011-07-25  9:09     ` Gleb Natapov
2011-07-26  1:00       ` Minoru Usui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110724063049.GM3044@redhat.com \
    --to=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=usui@mxm.nes.nec.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).