Subject: Re: Orphaned devices in config(8)
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-userlevel
Date: 10/09/2002 16:26:39
On Wed, 9 Oct 2002, Jason R Thorpe wrote:

> [ I have BCC'd tech-kern to notify that list of the discussion, but
>   since this is a purely userland issue, I'd like to conduct this
>   on tech-userlevel.  --thorpej ]
>
> With all the recent changes to config, it is now possible to completely
> orphan devices in the kernel configuration file.  Previously, this was
> not possible because of the internal data representation.  However, now
> that everything is done with strings, there is no reason to disallow
> orphaned devices.
>
> Consider the following:
>
> scsibus* at scsi?
> sd* at scsibus? target ? lun ?
>
> Right now, this is illegal because there is not a device with the "scsi"
> attribute in the config file.  However, it's possible that a device with
> the "scsi" attribute might appear later (see the "iscsi" example LKM I
> posted on tech-kern recently).
>
> Attached is a two line change (an "#if 0" and an "#endif") that makes
> orphaned devices work.  However, it's a pretty major semantic change,
> since previously e.g. removing all SCSI HBAs from a config file would
> cause an orphaned "scsibus" to cause an error.
>
> On the other hand, I don't really think that adding a new keyword like
> "orphan" is a natural way to describe a system's devie configuration.
>
> What are people's thoughts on this?

I'd like to add some sort of new keyword to indicate we expect some device
to look like an orphan. Something other than "orphan" is PERFECTLY fine,
and I'd prefer it. I agree with you that "orphan" as a term here is tied
to the old semantics and that we don't need to stick with those semantics.

I realize that you've changed (or plan to change) config so that it prints
warnings rather than erroring out. What I want is some way to say, for
device foo or attribute bar ("scsi" for instance), I don't want to see a
warning.

The reason I'd like to see this is so that we can tune our kernel configs
so that they produce no warnings. That way if I later make a config change
and I start getting warnings, I know to look into it.

It's mainly a UI issue - folks will notice the change from zero warnings
to one warning much more readily than the change from seven to eight.

Take care,

Bill