zdev: limit the derivation of ZDEV_SITE_ID

Currently ZDEV_SITE_ID is derived with the help of an additional
udev-rule, 40-zdev-id.rules. The sole purpose of this rule is to
determine the ZDEV_SITE_ID environment value with the help of zdev_id
binary. This solution is minimal, but this has some unwanted side-
effects. The zdev_id logic get executed for all the events, even
those completely unrelated to zdev/or site, and imports the unneeded
envionment values to the udev-db.

Instead of having an additional rule file, add this logic as part of
the udev-rule of those devices which are configured with site-support.
The logic will then be available on all those rules with the
site-supported devices only.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan
2023-09-18 17:54:53 +02:00
committed by Jan Höppner
parent 5637799c92
commit 07ff9e1da0
5 changed files with 30 additions and 66 deletions

View File

@@ -18,7 +18,6 @@
#define MODPROBE_PREFIX "s390x"
#define UDEV_PREFIX "41"
#define UDEV_SUFFIX ".rules"
#define ZDEV_PREFIX "40"
#define PATH_MODPROBE_CONF "/etc/modprobe.d"
#define PATH_MODPROBE "/sbin/modprobe"
@@ -66,7 +65,6 @@ char *path_get_zfcp_lun_dev(struct zfcp_lun_devid *);
char *path_get_zfcp_port_dev(struct zfcp_lun_devid *);
char *path_get_scsi_hctl_dev(const char *);
char *path_get_bus_attr(const char *, const char *);
char *path_get_zdev_rule(const char *name);
exit_code_t path_for_each(const char *,
exit_code_t (*callback)(const char *, const char *,