Bug 514023 - dracut: support booting from KVM virtio devices
Summary: dracut: support booting from KVM virtio devices
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: rawhide
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F12VirtBlocker
TreeView+ depends on / blocked
 
Reported: 2009-07-27 17:01 UTC by Mark McLoughlin
Modified: 2009-07-31 10:47 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-07-31 10:47:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dracut-pull-in-virtio-pci.patch (1000 bytes, patch)
2009-07-29 07:24 UTC, Mark McLoughlin
no flags Details | Diff

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


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