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

Valery Ushakov <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.