mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Implement internal device attributes
This change adds base infrastructure for implementing internal device
attributes. In the context of the zdev tools, an internal device
attribute is a new type of device attribute with the following
characteristics:
- Can be set and removed like normal device attributes
- Affects zdev-internal handling only
- Does not correspond to an actual device attribute, that is
it has no representation in SysFS
- Can not be set in the active configuration
- Name starts with "zdev:" to prevent conflicts with actual
device attributes
Values for internal device attributes are stored in udev rules alongside
the normal persistent configuration of a device. They are encoded as
udev environment variables. Note that they have no further effect on
udev processing.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
3c5644ccfd
commit
c0392efa39
@@ -1717,3 +1717,18 @@ void debug_init(int argc, char *argv[])
|
||||
fprintf(stderr, "%s\"%s\"", i > 0 ? ", " : "", argv[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
/* Return the last occurrence of @needle in @haystack, or %NULL if @needle
|
||||
* was not found. */
|
||||
char *misc_strrstr(const char *haystack, const char *needle)
|
||||
{
|
||||
char *result, *next;
|
||||
|
||||
result = strstr(haystack, needle);
|
||||
if (result) {
|
||||
while ((next = strstr(result + 1, needle)))
|
||||
result = next;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user