Bug 479239 - RHEL4 kvm virtio: mkinitrd support booting from KVM virtio devices
Summary: RHEL4 kvm virtio: mkinitrd support booting from KVM virtio devices
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mkinitrd
Version: 4.8
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Peter Jones
QA Contact: Alexander Todorov
URL:
Whiteboard:
Depends On:
Blocks: 446215
TreeView+ depends on / blocked
 
Reported: 2009-01-08 09:09 UTC by Chris Lalancette
Modified: 2011-01-21 16:54 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 20:30:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to correctly pull in virtio_pci when the boot device is virtio_blk (440 bytes, patch)
2009-01-08 09:09 UTC, Chris Lalancette
no flags Details | Diff
Cleaned up patch (467 bytes, patch)
2009-01-13 08:57 UTC, Hans de Goede
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1008 0 normal SHIPPED_LIVE mkinitrd bug fix update 2009-05-18 14:10:55 UTC

Description Chris Lalancette 2009-01-08 09:09:08 UTC
If you run kvm-qemu with e.g. --drive if=virtio,boot=on,file=foo.img then the
guest must use the KVM virtio drivers to mount the root device.

KVM exposes its virtio devices to the guest over PCI, requiring the guest to use
the virtio_pci driver for device enumeration. The actual block device driver is
virtio_blk.

Currently, if you boot using virtio and then try and create new initrd, the
initrd will include virtio_blk, but not virtio_net.

virtio_blk is to virtio_pci as standard disk drives is to the core PCI code, and
as virtio_blk is to lguest's device enumeration code and as xen_blkfront is to
xenbus.

Where virtio_pci differs from the others, though, is that it's a module and not
built in.

Comment 1 Chris Lalancette 2009-01-08 09:09:47 UTC
Created attachment 328451 [details]
Patch to correctly pull in virtio_pci when the boot device is virtio_blk

Comment 2 Hans de Goede 2009-01-13 08:57:00 UTC
Created attachment 328848 [details]
Cleaned up patch

We already have a list of modules with special deps in find module, so it seems cleaner to put it there.

Comment 3 Peter Jones 2009-01-13 15:31:26 UTC
Fixed in mkinitrd-4.2.1.13-4 .

Comment 5 Alexander Todorov 2009-02-11 10:16:57 UTC
Install PASSed with :
# qemu-kvm -drive file=/root/kvm.img,if=virtio,boot=on -net nic,model=virtio,macaddr=00:16:41:E4:1D:FF,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0,ifname=vnet0 -m 512 -cdrom /root/boot.iso -boot d

Boot FAILED with:
# qemu-kvm -drive file=/root/kvm.img,if=virtio,boot=on -net nic,model=virtio,macaddr=00:16:41:E4:1D:FF,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0,ifname=vnet0 -m 512

lsmod | grep virtio in rescue mode shows: (looks ok)
virtio_blk 8137 3 - Live 0xe081f000
virtio_net 10945 0 - Live 0xe08a9000
virtio_pci 8385 0 - Live 0xe08a5000
virtio 5445 3 virtio_blk,virtio_net,virtio_pci, Live 0xe0866000
virtio_ring 4033 1 virtio_pci, Live 0xe0864000

zcat /boot/initrd-$(version).img | cpio -t | grep virtio in rescue mode shows:
lib/virtio.ko
lib/virtio_blk.ko


while in RHEL 5 we had (see bug #446232 comment #17):
# zcat /boot/initrd-2.6.18-122.el5.img | cpio -t | grep virtio
16057 blocks
lib/virtio_pci.ko
lib/virtio_blk.ko
lib/virtio.ko
lib/virtio_ring.ko

This is with mkinitrd-4.2.1.13-1

Comment 6 Alexander Todorov 2009-02-11 10:37:02 UTC
With mkinitrd-4.2.1.13-4 (latest nightly)

# zcat /boot/initrd-2.6.9-80.EL.img | cpio -t | grep virtio
lib/virtio.ko
lib/virtio_blk.ko
lib/virtio_ring.ko
lib/virtio_pci.ko

moving to VERIFIED

Comment 8 errata-xmlrpc 2009-05-18 20:30:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1008.html


Note You need to log in before you can comment on or make changes to this bug.