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.
Created attachment 328451 [details] Patch to correctly pull in virtio_pci when the boot device is virtio_blk
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.
Fixed in mkinitrd-4.2.1.13-4 .
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
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
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