It might even get worse, as during device setup things like 'slave_alloc' etc is getting called, which has a fair chance of getting confused for non-existing devices. Cf qla2xxx:qla2xx_slave_alloc() is calling starget_to_rport(), which will get us a nice oops when accessing a target which is _not_ the child of a fc remote port.FWIW, the only other driver (gdth) which I see uses this API has this_id = -1 in the scsi host template.But alright, I'll give it a go; let's see what I'll end up with.note: If we want a fixed scsi_device per host, calling scsi_mq_setup_tags() -> scsi_get_host_dev() will fail as shost state is not running. Maybe we need to juggle some things there to provide a generic solution.
Yes, something similar happens for libsas [hence my hack], where sas_alloc_target()->sas_find_dev_by_rphy() fails as it cannot handle rphy for scsi host as parent properly.
And this is why I'm not utterly keen on this approach; auditing all these callbacks is _not_ fun.
Understood. And if you can't test them, then a change like this is too risky for those drivers.
Cheers, John