Device identifiers & auto-numbering

Hi,

I want to change the way devices are given an identifier. Now many devices (e.g. ethernetcards) are given an name, which contains an auto-number. e.g. eth0, eth1 etc.
Since the change in the plugin loading and the devices are started in parallel, it is no longer certain which device gets which number.

To fix this, I want to remove the auto-numbering feature and set the requirement for device identifiers that they uniquely identify the device. Being unique can come from the location of the device (e.g. hda0; first ide disk, first partition) or from a unique identifier on the device itself (e.g. eth-[macaddress]).

I hope this naming scheme to be such that you can safely use these identifiers for configuration binding purposes, such as a map ("eth-00:04:5a:73:45:ee" -> ip:192.168.100.1)

What do you think?

Ewout

Numbering after they have all been found ?

What do you think of numbering devices after they have all been found at startup. Thus, each class of device can assign a unique number by sorting their :
- mac adress for ethernet cards
- serial number for some devices
- ide disk number and partition number for block devices
First sorted item will have number 0, ...

Hot pluggable device?

That will not work for hot-pluggable devices.
Ewout

what about bus?

hi,

what about numbering a device on apperance at the bus it is connected to?
So you can differ between hotpluging bus (USB) and others (PCI).
On USB I would prefer the device-info to number a device (like the MAC sheme you posted or something similar)

Trickkiste

eth-?

eth-00:04:5a:73:45:ee - this looks a bit too long and might be confusing later with IPv6 adresses that also use : and hexa notation.