Bug 514023

Summary: dracut: support booting from KVM virtio devices
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: dracutAssignee: Harald Hoyer <harald>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: rawhideCC: harald, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-31 10:47:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 498968    
Attachments:
Description Flags
dracut-pull-in-virtio-pci.patch none

Description Mark McLoughlin 2009-07-27 17:01:19 UTC
With dracut-0.7-2.fc12

On a KVM guest using a virtio drive for its root filesystem:

  $> dracut --force /boot/dracut-$(uname -r).img $(uname -r)
  W: Possible missing firmware tehuti/firmware.bin for module tehuti.ko'
  W: Possible missing firmware ql8100_fw.bin for module qla2xxx.ko
  W: Possible missing firmware aic94xx-seq.fw for module aic94xx.ko

On reboot with that initrd, you get:

  "No root device found"

The reason is clear - there is no virtio-pci driver included in the initrd.

See bug #444155 for the hack we needed to add to mkinitrd

Background here is that we pull in the virtio_blk.ko in 90kernel-modules/installkernel because it uses blk_init_queue, and we pull in virtio.ko because virtio_blk.ko requires it

However, we still may potentially need a module for the actual virtio bus implementation - for e.g. lguest and kvm=s390, this implementation is built into the kernel, but for KVM it's the virtio-pci module. Nothing requires virtio-pci, so there's nothing to pull it in automatically

See also:

  http://www.mail-archive.com/kvm@vger.kernel.org/msg08005.html

Only solution that I see is including all virtio bus implementations (i.e. modules that call register_virtio_device) if any virtio driver is to be included (i.e. modules that call register_virtio_driver). Such a hack is attached, although the way it's done it would only work for block drivers

Comment 1 Harald Hoyer 2009-07-28 08:49:41 UTC
> Such a hack is attached, although the way it's done it would only work for block drivers

Missing the attachment :)

Comment 2 Mark McLoughlin 2009-07-29 07:24:34 UTC
Created attachment 355501 [details]
dracut-pull-in-virtio-pci.patch

Comment 4 Mark McLoughlin 2009-07-30 15:38:47 UTC
Yep, that'll work ... except:

  1) You only need register_virtio_device ... register_virtio_driver will
     cause it to pull in e.g. virtio-net and virtio-console

  2) You also need eth_type_trans|register_virtio_device in 
     40network/installkernel or virtio NICs won't work under KVM

Comment 5 Harald Hoyer 2009-07-31 10:47:21 UTC
pushed to upstream git