tech-kern archive

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

Re: config: conditional at clause (was: vio9p vs. GENERIC.local vs. XEN3_DOM[0U])



On Mon, Aug 12, 2024 at 12:44:34 +0300, Valery Ushakov wrote:

> On Mon, Aug 12, 2024 at 10:54:50 +0200, Edgar Fuß wrote:
> 
> > I have no idea about config's internal workings, but what about
> >
> > 	vio9p* at? virtio*
> 
> That's cute.  That might be a nice thing to have in config.
> 
> I guess I never do build.sh release b/c I found vio9p* at virtio? in
> my own GENERIC.local (probably from the time when I experimented with
> 9p in VBox).
> 
> Config ifdef syntax doesn't help here b/c all configs *do* include
> files.virtio (from MI sys/conf/files) in their first, options
> description, part, so ifdef virtio is always true.  The test it needs
> is for actual instances (the second, "option selection", part of the
> config that a user commonly perceives as the "config file")

On the second thought at? vs at prevents copy-pasting of config
chunks, so a form of ifdef that checks instantiation is probably
better and is pretty trivial to add

  ifinstance virtio
  vio9p* at virtio?
  endif

in GENERIC.local makes both GENERIC and XEN* config ok with vio9p
configured in GENERIC.  The test is for

    const struct devbase *d = ht_lookup(devbasetab, intern(p));
    return d != NULL && d->d_ihead != NULL;


I'm still not entirely sure, why XEN kernels include GENERIC.local in
the first place though.  If one needs a fragile maze of includes just
to avoid a few lines being copy-pasted, that doesn't feel like a win.

-uwe


Home | Main Index | Thread Index | Old Index