Re: [libvirt] PATCH: Xen PCI device passthrough

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hi,

> +static const char *
> +pciFindStubDriver(virConnectPtr conn)
> +{
> +    char drvpath[PATH_MAX];
> +    int probed = 0;
> +
> +recheck:
> +    pciDriverDir(drvpath, sizeof(drvpath), "pci-stub");
> +    if (virFileExists(drvpath))
> +        return "pci-stub";
> +    pciDriverDir(drvpath, sizeof(drvpath), "pciback");
> +    if (virFileExists(drvpath))
> +        return "pciback";
> +
> +    if (!probed) {
> +        const char *const stubprobe[] = { MODPROBE, "pci-stub", NULL };
> +        const char *const backprobe[] = { MODPROBE, "pciback", NULL };on xen.

> +
> +        probed = 1;
> +        if (virRun(conn, stubprobe, NULL) < 0 &&
> +            virRun(conn, backprobe, NULL) < 0) {
>              char ebuf[1024];
> -            VIR_WARN(_("modprobe %s failed: %s"), stub_module,
> +            VIR_WARN(_("failed to load pci-stub or pciback drivers: %s"),
>                       virStrerror(errno, ebuf, sizeof ebuf));
> +            return 0;
>          }
> +
> +        goto recheck;
>      }

I'd tend to reverse that ordering.  It isn't a issue today, but once
pv_ops/dom0 gets pciback support you might actually have both modules
present for a given kernel.

pci-stub doesn't do anything special and will load just fine in any
environment.  pciback is xen-specific (especially the part which handles
pci passthrough to pv domains) and should not load when not running on xen.

cheers,
  Gerd

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]