Bug 479239 - RHEL4 kvm virtio: mkinitrd support booting from KVM virtio devices
RHEL4 kvm virtio: mkinitrd support booting from KVM virtio devices
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mkinitrd (Show other bugs)
4.8
All Linux
low Severity medium
: rc
: ---
Assigned To: Peter Jones
Alexander Todorov
:
Depends On:
Blocks: 446215
  Show dependency treegraph
 
Reported: 2009-01-08 04:09 EST by Chris Lalancette
Modified: 2011-01-21 11:54 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 16:30:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Chris Lalancette 2009-01-08 04:09:08 EST
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 04:09:47 EST
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 03:57:00 EST
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 10:31:26 EST
Fixed in mkinitrd-4.2.1.13-4 .
Comment 5 Alexander Todorov 2009-02-11 05:16:57 EST
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 05:37:02 EST
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 16:30:01 EDT
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.