diff options
author | Chris Lalancette <clalance@redhat.com> | 2009-01-13 13:41:40 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-01-13 13:41:40 +0100 |
commit | 3fbb84e8f04b1811b0e4376ac4d1bc8d94c027cd (patch) | |
tree | 8b30c5557cf60a7d3a42adc4c8a789ccbda1d219 | |
parent | db3b465bdb51abcf2808e3aba98e5537c3062c78 (diff) | |
download | anaconda-3fbb84e8f04b1811b0e4376ac4d1bc8d94c027cd.tar.gz anaconda-3fbb84e8f04b1811b0e4376ac4d1bc8d94c027cd.tar.xz anaconda-3fbb84e8f04b1811b0e4376ac4d1bc8d94c027cd.zip |
Probe virtio devices separately (#479134)
Probe virtio devices separately (#479134)
-rw-r--r-- | loader2/hardware.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/loader2/hardware.c b/loader2/hardware.c index 9bada3538..e5e3a0679 100644 --- a/loader2/hardware.c +++ b/loader2/hardware.c @@ -59,6 +59,41 @@ int canProbeDevices(void) { return 1; } +static void probeVirtio(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, int flags) { + struct device ** devices, ** device; + char modules[1024]; + + logMessage("probing virtio buse"); + + devices = probeDevices(CLASS_UNSPEC, BUS_VIRTIO, PROBE_ALL); + + logMessage("finished virtio bus probing"); + + *modules = '\0'; + + for (device = devices; device && *device; device++) { + char *driver = (*device)->driver; + + if (!driver) { + logMessage("ignoring driverless device %s", (*device)->desc); + } else if (FL_NONET(flags) && ((*device)->type == CLASS_NETWORK)) { + logMessage("ignoring network device %s (%s)", + (*device)->desc, driver); + } else { + if (*modules) + strcat(modules, ":"); + strcat(modules, driver); + } + + freeDevice(*device); + } + + free(devices); + + if (*modules) + mlLoadModuleSet(modules, modLoaded, modDeps, modInfo, flags); +} + static int detectHardware(moduleInfoSet modInfo, char *** modules, int flags) { struct device ** devices, ** device; @@ -298,6 +333,10 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, mlLoadModuleSet(modules, modLoaded, modDeps, modInfo, flags); + /* The virtio bus only becomes available after loading the + virtio_pci driver so we must probe virtio devices separately */ + probeVirtio(modInfo, modLoaded, modDeps, flags); + startPcmciaDevices(modLoaded, flags); } else logMessage("found nothing"); |