devfsadm.c (aab83bb83be7342f6cfccaed8d5fe0b2f404855d) devfsadm.c (406fc5100dac8d225a315a6def6be8d628f34e24)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2016 Toomas Soome <tsoome@me.com>
23 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26/*
27 * Devfsadm replaces drvconfig, audlinks, disks, tapes, ports, devlinks
28 * as a general purpose device administrative utility. It creates
29 * devices special files in /devices and logical links in /dev, and
30 * coordinates updates to /etc/path_to_instance with the kernel. It

--- 3253 unchanged lines hidden (view full) ---

3284 * any link whose contents match "valid_link_contents" with a corresponding link
3285 * which does not match "valid_link". Any such matches are stale and removed.
3286 *
3287 * This happens outside the context of a "reparenting" so we dont need
3288 * redirection.
3289 */
3290void
3291devfsadm_rm_stale_links(char *dir_re, char *valid_link, di_node_t node,
24 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
25 */
26
27/*
28 * Devfsadm replaces drvconfig, audlinks, disks, tapes, ports, devlinks
29 * as a general purpose device administrative utility. It creates
30 * devices special files in /devices and logical links in /dev, and
31 * coordinates updates to /etc/path_to_instance with the kernel. It

--- 3253 unchanged lines hidden (view full) ---

3285 * any link whose contents match "valid_link_contents" with a corresponding link
3286 * which does not match "valid_link". Any such matches are stale and removed.
3287 *
3288 * This happens outside the context of a "reparenting" so we dont need
3289 * redirection.
3290 */
3291void
3292devfsadm_rm_stale_links(char *dir_re, char *valid_link, di_node_t node,
3292 di_minor_t minor)
3293 di_minor_t minor)
3293{
3294 link_t *link;
3295 linkhead_t *head;
3296 char phy_path[PATH_MAX + 1];
3297 char *valid_link_contents;
3298 char *dev_path;
3299 char rmlink[PATH_MAX + 1];
3300

--- 1531 unchanged lines hidden (view full) ---

4832 * applicable to a different subset of links in /dev. For example, controller
4833 * numbers may be determined by a combination of disk symlinks in /dev/[r]dsk
4834 * and controller symlinks in /dev/cfg, with the two sets requiring different
4835 * rules to derive the "substring of interest". In such cases, the rules
4836 * array will have more than one element.
4837 */
4838int
4839devfsadm_enumerate_int(char *devfs_path, int index, char **buf,
3294{
3295 link_t *link;
3296 linkhead_t *head;
3297 char phy_path[PATH_MAX + 1];
3298 char *valid_link_contents;
3299 char *dev_path;
3300 char rmlink[PATH_MAX + 1];
3301

--- 1531 unchanged lines hidden (view full) ---

4833 * applicable to a different subset of links in /dev. For example, controller
4834 * numbers may be determined by a combination of disk symlinks in /dev/[r]dsk
4835 * and controller symlinks in /dev/cfg, with the two sets requiring different
4836 * rules to derive the "substring of interest". In such cases, the rules
4837 * array will have more than one element.
4838 */
4839int
4840devfsadm_enumerate_int(char *devfs_path, int index, char **buf,
4840 devfsadm_enumerate_t rules[], int nrules)
4841 devfsadm_enumerate_t rules[], int nrules)
4841{
4842 return (find_enum_id(rules, nrules,
4843 devfs_path, index, "0", INTEGER, buf, 0));
4844}
4845
4846int
4847disk_enumerate_int(char *devfs_path, int index, char **buf,
4848 devfsadm_enumerate_t rules[], int nrules)
4849{
4850 return (find_enum_id(rules, nrules,
4851 devfs_path, index, "0", INTEGER, buf, 1));
4852}
4853
4854/*
4855 * Same as above, but allows a starting value to be specified.
4856 * Private to devfsadm.... used by devlinks.
4857 */
4858static int
4859devfsadm_enumerate_int_start(char *devfs_path, int index, char **buf,
4842{
4843 return (find_enum_id(rules, nrules,
4844 devfs_path, index, "0", INTEGER, buf, 0));
4845}
4846
4847int
4848disk_enumerate_int(char *devfs_path, int index, char **buf,
4849 devfsadm_enumerate_t rules[], int nrules)
4850{
4851 return (find_enum_id(rules, nrules,
4852 devfs_path, index, "0", INTEGER, buf, 1));
4853}
4854
4855/*
4856 * Same as above, but allows a starting value to be specified.
4857 * Private to devfsadm.... used by devlinks.
4858 */
4859static int
4860devfsadm_enumerate_int_start(char *devfs_path, int index, char **buf,
4860 devfsadm_enumerate_t rules[], int nrules, char *start)
4861 devfsadm_enumerate_t rules[], int nrules, char *start)
4861{
4862 return (find_enum_id(rules, nrules,
4863 devfs_path, index, start, INTEGER, buf, 0));
4864}
4865
4866/*
4867 * devfsadm_enumerate_char serves as a generic counter returning
4868 * a single letter.
4869 */
4870int
4871devfsadm_enumerate_char(char *devfs_path, int index, char **buf,
4862{
4863 return (find_enum_id(rules, nrules,
4864 devfs_path, index, start, INTEGER, buf, 0));
4865}
4866
4867/*
4868 * devfsadm_enumerate_char serves as a generic counter returning
4869 * a single letter.
4870 */
4871int
4872devfsadm_enumerate_char(char *devfs_path, int index, char **buf,
4872 devfsadm_enumerate_t rules[], int nrules)
4873 devfsadm_enumerate_t rules[], int nrules)
4873{
4874 return (find_enum_id(rules, nrules,
4875 devfs_path, index, "a", LETTER, buf, 0));
4876}
4877
4878/*
4879 * Same as above, but allows a starting char to be specified.
4880 * Private to devfsadm - used by ports module (port_link.c)
4881 */
4882int
4883devfsadm_enumerate_char_start(char *devfs_path, int index, char **buf,
4874{
4875 return (find_enum_id(rules, nrules,
4876 devfs_path, index, "a", LETTER, buf, 0));
4877}
4878
4879/*
4880 * Same as above, but allows a starting char to be specified.
4881 * Private to devfsadm - used by ports module (port_link.c)
4882 */
4883int
4884devfsadm_enumerate_char_start(char *devfs_path, int index, char **buf,
4884 devfsadm_enumerate_t rules[], int nrules, char *start)
4885 devfsadm_enumerate_t rules[], int nrules, char *start)
4885{
4886 return (find_enum_id(rules, nrules,
4887 devfs_path, index, start, LETTER, buf, 0));
4888}
4889
4890
4891/*
4892 * For a given numeral_set (see get_cached_set for desc of numeral_set),
4893 * search all cached entries looking for matches on a specified substring
4894 * of devfs_path. The substring is derived from devfs_path based on the
4895 * rule specified by "index". If a match is found on a cached entry,
4896 * return the enumerated id in buf. Otherwise, create a new id by calling
4897 * new_id, then cache and return that entry.
4898 */
4899static int
4900find_enum_id(devfsadm_enumerate_t rules[], int nrules,
4886{
4887 return (find_enum_id(rules, nrules,
4888 devfs_path, index, start, LETTER, buf, 0));
4889}
4890
4891
4892/*
4893 * For a given numeral_set (see get_cached_set for desc of numeral_set),
4894 * search all cached entries looking for matches on a specified substring
4895 * of devfs_path. The substring is derived from devfs_path based on the
4896 * rule specified by "index". If a match is found on a cached entry,
4897 * return the enumerated id in buf. Otherwise, create a new id by calling
4898 * new_id, then cache and return that entry.
4899 */
4900static int
4901find_enum_id(devfsadm_enumerate_t rules[], int nrules,
4901 char *devfs_path, int index, char *min, int type, char **buf,
4902 int multiple)
4902 char *devfs_path, int index, char *min, int type, char **buf,
4903 int multiple)
4903{
4904 numeral_t *matchnp;
4905 numeral_t *numeral;
4906 int matchcount = 0;
4907 char *cmp_str;
4908 char *fcn = "find_enum_id";
4909 numeral_set_t *set;
4910

--- 83 unchanged lines hidden (view full) ---

4994 * -1 : on error.
4995 * 0/1/2 : Number of matches.
4996 * Returns the matching element only if there is a single match.
4997 * If the "uncached" flag is set, derives the "cmp_str" afresh
4998 * for the match instead of using cached values.
4999 */
5000static int
5001lookup_enum_cache(numeral_set_t *set, char *cmp_str,
4904{
4905 numeral_t *matchnp;
4906 numeral_t *numeral;
4907 int matchcount = 0;
4908 char *cmp_str;
4909 char *fcn = "find_enum_id";
4910 numeral_set_t *set;
4911

--- 83 unchanged lines hidden (view full) ---

4995 * -1 : on error.
4996 * 0/1/2 : Number of matches.
4997 * Returns the matching element only if there is a single match.
4998 * If the "uncached" flag is set, derives the "cmp_str" afresh
4999 * for the match instead of using cached values.
5000 */
5001static int
5002lookup_enum_cache(numeral_set_t *set, char *cmp_str,
5002 devfsadm_enumerate_t rules[], int index, numeral_t **matchnpp)
5003 devfsadm_enumerate_t rules[], int index, numeral_t **matchnpp)
5003{
5004 int matchcount = 0, rv = -1;
5005 int uncached;
5006 numeral_t *np;
5007 char *fcn = "lookup_enum_cache";
5008 char *cp;
5009
5010 *matchnpp = NULL;

--- 374 unchanged lines hidden (view full) ---

5385 return (s_strdup(tempbuff));
5386 }
5387
5388 return (s_strdup(""));
5389}
5390
5391static int
5392enumerate_parse(char *rsvstr, char *path_left, numeral_set_t *setp,
5004{
5005 int matchcount = 0, rv = -1;
5006 int uncached;
5007 numeral_t *np;
5008 char *fcn = "lookup_enum_cache";
5009 char *cp;
5010
5011 *matchnpp = NULL;

--- 374 unchanged lines hidden (view full) ---

5386 return (s_strdup(tempbuff));
5387 }
5388
5389 return (s_strdup(""));
5390}
5391
5392static int
5393enumerate_parse(char *rsvstr, char *path_left, numeral_set_t *setp,
5393 devfsadm_enumerate_t rules[], int index)
5394 devfsadm_enumerate_t rules[], int index)
5394{
5395 char *slash1 = NULL;
5396 char *slash2 = NULL;
5397 char *numeral_id;
5398 char *path_left_save;
5399 char *rsvstr_save;
5400 int ret = 0;
5401 static int warned = 0;

--- 99 unchanged lines hidden (view full) ---

5501 * of path_left, which is an RE. If a match is found, but there are more
5502 * components of path_left, then recurse, otherwise, if we have reached
5503 * the last component of path_left, call create_cached_numerals for each
5504 * file. At some point, recurse_dev_re() should be rewritten so that this
5505 * function can be eliminated.
5506 */
5507static void
5508enumerate_recurse(char *current_dir, char *path_left, numeral_set_t *setp,
5395{
5396 char *slash1 = NULL;
5397 char *slash2 = NULL;
5398 char *numeral_id;
5399 char *path_left_save;
5400 char *rsvstr_save;
5401 int ret = 0;
5402 static int warned = 0;

--- 99 unchanged lines hidden (view full) ---

5502 * of path_left, which is an RE. If a match is found, but there are more
5503 * components of path_left, then recurse, otherwise, if we have reached
5504 * the last component of path_left, call create_cached_numerals for each
5505 * file. At some point, recurse_dev_re() should be rewritten so that this
5506 * function can be eliminated.
5507 */
5508static void
5509enumerate_recurse(char *current_dir, char *path_left, numeral_set_t *setp,
5509 devfsadm_enumerate_t rules[], int index)
5510 devfsadm_enumerate_t rules[], int index)
5510{
5511 char *slash;
5512 char *new_path;
5513 char *numeral_id;
5514 finddevhdl_t fhandle;
5515 const char *fp;
5516
5517 if (finddev_readdir(current_dir, &fhandle) != 0) {

--- 138 unchanged lines hidden (view full) ---

5656
5657/*
5658 * This function is called for every file which matched the leaf
5659 * component of the RE. If the "numeral_id" is not already on the
5660 * numeral set's numeral list, add it and its physical path.
5661 */
5662static void
5663create_cached_numeral(char *path, numeral_set_t *setp, char *numeral_id,
5511{
5512 char *slash;
5513 char *new_path;
5514 char *numeral_id;
5515 finddevhdl_t fhandle;
5516 const char *fp;
5517
5518 if (finddev_readdir(current_dir, &fhandle) != 0) {

--- 138 unchanged lines hidden (view full) ---

5657
5658/*
5659 * This function is called for every file which matched the leaf
5660 * component of the RE. If the "numeral_id" is not already on the
5661 * numeral set's numeral list, add it and its physical path.
5662 */
5663static void
5664create_cached_numeral(char *path, numeral_set_t *setp, char *numeral_id,
5664 devfsadm_enumerate_t rules[], int index)
5665 devfsadm_enumerate_t rules[], int index)
5665{
5666 char linkbuf[PATH_MAX + 1];
5667 char lpath[PATH_MAX + 1];
5668 char *linkptr, *cmp_str;
5669 numeral_t *np;
5670 int linksize;
5671 struct stat sb;
5672 char *contents;

--- 160 unchanged lines hidden (view full) ---

5833/*
5834 * This function copies links, dirs, and device special files.
5835 * Note that it always returns DEVFSADM_SUCCESS, so that nftw doesn't
5836 * abort.
5837 */
5838/*ARGSUSED*/
5839static int
5840devfsadm_copy_file(const char *file, const struct stat *stat,
5666{
5667 char linkbuf[PATH_MAX + 1];
5668 char lpath[PATH_MAX + 1];
5669 char *linkptr, *cmp_str;
5670 numeral_t *np;
5671 int linksize;
5672 struct stat sb;
5673 char *contents;

--- 160 unchanged lines hidden (view full) ---

5834/*
5835 * This function copies links, dirs, and device special files.
5836 * Note that it always returns DEVFSADM_SUCCESS, so that nftw doesn't
5837 * abort.
5838 */
5839/*ARGSUSED*/
5840static int
5841devfsadm_copy_file(const char *file, const struct stat *stat,
5841 int flags, struct FTW *ftw)
5842 int flags, struct FTW *ftw)
5842{
5843 struct stat sp;
5844 dev_t newdev;
5845 char newfile[PATH_MAX + 1];
5846 char linkcontents[PATH_MAX + 1];
5847 int bytes;
5848 const char *fcn = "devfsadm_copy_file";
5849

--- 435 unchanged lines hidden (view full) ---

6285/*
6286 *
6287 * For a single line entry in devlink.tab, split the line into fields
6288 * selector, p_link, and an optionally s_link. If s_link field is not
6289 * present, then return NULL in s_link (not NULL string).
6290 */
6291static int
6292split_devlinktab_entry(char *entry, char **selector, char **p_link,
5843{
5844 struct stat sp;
5845 dev_t newdev;
5846 char newfile[PATH_MAX + 1];
5847 char linkcontents[PATH_MAX + 1];
5848 int bytes;
5849 const char *fcn = "devfsadm_copy_file";
5850

--- 435 unchanged lines hidden (view full) ---

6286/*
6287 *
6288 * For a single line entry in devlink.tab, split the line into fields
6289 * selector, p_link, and an optionally s_link. If s_link field is not
6290 * present, then return NULL in s_link (not NULL string).
6291 */
6292static int
6293split_devlinktab_entry(char *entry, char **selector, char **p_link,
6293 char **s_link)
6294 char **s_link)
6294{
6295 char *tab;
6296
6297 *selector = entry;
6298
6299 if ((tab = strchr(entry, TAB)) != NULL) {
6300 *tab = '\0';
6301 *p_link = ++tab;

--- 419 unchanged lines hidden (view full) ---

6721 }
6722 *anchored_re = '\0';
6723
6724 return (DEVFSADM_SUCCESS);
6725}
6726
6727static int
6728construct_devlink(char *link, link_list_t *link_build, char *contents,
6295{
6296 char *tab;
6297
6298 *selector = entry;
6299
6300 if ((tab = strchr(entry, TAB)) != NULL) {
6301 *tab = '\0';
6302 *p_link = ++tab;

--- 419 unchanged lines hidden (view full) ---

6722 }
6723 *anchored_re = '\0';
6724
6725 return (DEVFSADM_SUCCESS);
6726}
6727
6728static int
6729construct_devlink(char *link, link_list_t *link_build, char *contents,
6729 di_minor_t minor, di_node_t node, char *pattern)
6730 di_minor_t minor, di_node_t node, char *pattern)
6730{
6731 int counter_offset = -1;
6732 devfsadm_enumerate_t rules[1] = {NULL};
6733 char templink[PATH_MAX + 1];
6734 char *buff;
6735 char start[10];
6736 char *node_path;
6737 char anchored_re[PATH_MAX + 1];

--- 390 unchanged lines hidden (view full) ---

7128 * /etc/minor_perm. If currently in installation mode, check for
7129 * possible major number translations from the miniroot to the installed
7130 * root's name_to_major table. Note that there can be multiple matches,
7131 * but the last match takes effect. pts seems to rely on this
7132 * implementation behavior.
7133 */
7134static void
7135getattr(char *phy_path, char *aminor, int spectype, dev_t dev, mode_t *mode,
6731{
6732 int counter_offset = -1;
6733 devfsadm_enumerate_t rules[1] = {NULL};
6734 char templink[PATH_MAX + 1];
6735 char *buff;
6736 char start[10];
6737 char *node_path;
6738 char anchored_re[PATH_MAX + 1];

--- 390 unchanged lines hidden (view full) ---

7129 * /etc/minor_perm. If currently in installation mode, check for
7130 * possible major number translations from the miniroot to the installed
7131 * root's name_to_major table. Note that there can be multiple matches,
7132 * but the last match takes effect. pts seems to rely on this
7133 * implementation behavior.
7134 */
7135static void
7136getattr(char *phy_path, char *aminor, int spectype, dev_t dev, mode_t *mode,
7136 uid_t *uid, gid_t *gid)
7137 uid_t *uid, gid_t *gid)
7137{
7138 char devname[PATH_MAX + 1];
7139 char *node_name;
7140 char *minor_name;
7141 int match = FALSE;
7142 int is_clone;
7143 int mp_drvname_matches_node_name;
7144 int mp_drvname_matches_minor_name;

--- 1069 unchanged lines hidden (view full) ---

8214 if (strcmp(class, EC_DEV_ADD) != 0 &&
8215 strcmp(class, EC_DEV_REMOVE) != 0)
8216 return (nvl);
8217
8218 if (driver_name == NULL || instance == -1)
8219 goto out;
8220
8221 if (strcmp(subclass, ESC_DISK) == 0) {
7138{
7139 char devname[PATH_MAX + 1];
7140 char *node_name;
7141 char *minor_name;
7142 int match = FALSE;
7143 int is_clone;
7144 int mp_drvname_matches_node_name;
7145 int mp_drvname_matches_minor_name;

--- 1069 unchanged lines hidden (view full) ---

8215 if (strcmp(class, EC_DEV_ADD) != 0 &&
8216 strcmp(class, EC_DEV_REMOVE) != 0)
8217 return (nvl);
8218
8219 if (driver_name == NULL || instance == -1)
8220 goto out;
8221
8222 if (strcmp(subclass, ESC_DISK) == 0) {
8223 /*
8224 * While we're removing labeled lofi device, we will receive
8225 * event for every registered minor device and lastly,
8226 * an event with minor set to NULL, as in following example:
8227 * class: EC_dev_remove subclass: disk
8228 * node_path: /pseudo/lofi@1 driver: lofi minor: u,raw
8229 * class: EC_dev_remove subclass: disk
8230 * node_path: /pseudo/lofi@1 driver: lofi minor: NULL
8231 *
8232 * When we receive this last event with minor set to NULL,
8233 * all lofi minor devices are already removed and the call to
8234 * lookup_disk_dev_name() would result in error.
8235 * To prevent name lookup error messages for this case, we
8236 * need to filter out that last event.
8237 */
8238 if (strcmp(class, EC_DEV_REMOVE) == 0 &&
8239 strcmp(driver_name, "lofi") == 0 && minor == NULL) {
8240 nvlist_free(nvl);
8241 return (NULL);
8242 }
8222 if ((dev_name = lookup_disk_dev_name(node_path)) == NULL) {
8223 dev_name_lookup_err = 1;
8224 goto out;
8225 }
8226 } else if (strcmp(subclass, ESC_NETWORK) == 0) {
8227 if ((dev_name = lookup_network_dev_name(node_path, driver_name))
8228 == NULL) {
8229 dev_name_lookup_err = 1;

--- 4 unchanged lines hidden (view full) ---

8234 dev_name_lookup_err = 1;
8235 goto out;
8236 }
8237 } else if (strcmp(subclass, ESC_LOFI) == 0) {
8238 /*
8239 * The raw minor node is created or removed after the block
8240 * node. Lofi devfs events are dependent on this behavior.
8241 * Generate the sysevent only for the raw minor node.
8243 if ((dev_name = lookup_disk_dev_name(node_path)) == NULL) {
8244 dev_name_lookup_err = 1;
8245 goto out;
8246 }
8247 } else if (strcmp(subclass, ESC_NETWORK) == 0) {
8248 if ((dev_name = lookup_network_dev_name(node_path, driver_name))
8249 == NULL) {
8250 dev_name_lookup_err = 1;

--- 4 unchanged lines hidden (view full) ---

8255 dev_name_lookup_err = 1;
8256 goto out;
8257 }
8258 } else if (strcmp(subclass, ESC_LOFI) == 0) {
8259 /*
8260 * The raw minor node is created or removed after the block
8261 * node. Lofi devfs events are dependent on this behavior.
8262 * Generate the sysevent only for the raw minor node.
8263 *
8264 * If the lofi mapping is created, we will receive the following
8265 * event: class: EC_dev_add subclass: lofi minor: NULL
8266 *
8267 * As in case of EC_dev_add, the minor is NULL pointer,
8268 * to get device links created, we will need to provide the
8269 * type of minor node for lookup_lofi_dev_name()
8270 *
8271 * If the lofi device is unmapped, we will receive following
8272 * events:
8273 * class: EC_dev_remove subclass: lofi minor: disk
8274 * class: EC_dev_remove subclass: lofi minor: disk,raw
8275 * class: EC_dev_remove subclass: lofi minor: NULL
8242 */
8276 */
8243 if (strstr(minor, "raw") == NULL) {
8244 if (nvl) {
8245 nvlist_free(nvl);
8246 }
8277
8278 if (strcmp(class, EC_DEV_ADD) == 0 && minor == NULL)
8279 minor = "disk,raw";
8280
8281 if (minor == NULL || strstr(minor, "raw") == NULL) {
8282 nvlist_free(nvl);
8247 return (NULL);
8248 }
8249 if ((dev_name = lookup_lofi_dev_name(node_path, minor)) ==
8250 NULL) {
8251 dev_name_lookup_err = 1;
8252 goto out;
8253 }
8254 }

--- 114 unchanged lines hidden (view full) ---

8369 syseventq_front = NULL;
8370 free(tmp);
8371 }
8372 (void) mutex_unlock(&syseventq_mutex);
8373}
8374
8375static void
8376build_and_enq_event(char *class, char *subclass, char *node_path,
8283 return (NULL);
8284 }
8285 if ((dev_name = lookup_lofi_dev_name(node_path, minor)) ==
8286 NULL) {
8287 dev_name_lookup_err = 1;
8288 goto out;
8289 }
8290 }

--- 114 unchanged lines hidden (view full) ---

8405 syseventq_front = NULL;
8406 free(tmp);
8407 }
8408 (void) mutex_unlock(&syseventq_mutex);
8409}
8410
8411static void
8412build_and_enq_event(char *class, char *subclass, char *node_path,
8377 di_node_t node, char *minor)
8413 di_node_t node, char *minor)
8378{
8379 nvlist_t *nvl;
8380
8381 vprint(CHATTY_MID, "build_and_enq_event(%s, %s, %s, 0x%8.8x)\n",
8382 class, subclass, node_path, (int)node);
8383
8384 if (node != DI_NODE_NIL)
8385 nvl = build_event_attributes(class, subclass, node_path, node,

--- 353 unchanged lines hidden ---
8414{
8415 nvlist_t *nvl;
8416
8417 vprint(CHATTY_MID, "build_and_enq_event(%s, %s, %s, 0x%8.8x)\n",
8418 class, subclass, node_path, (int)node);
8419
8420 if (node != DI_NODE_NIL)
8421 nvl = build_event_attributes(class, subclass, node_path, node,

--- 353 unchanged lines hidden ---