diff options
author | Dan McDonald <danmcd@joyent.com> | 2021-01-25 11:14:41 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2021-01-25 11:14:52 -0500 |
commit | ca7e98efc99f1be718cca849bd004b6d5ca2ce58 (patch) | |
tree | 8da70ed97c791a851b3677d8c4efacb545ffd3b3 /usr/src/lib/libdiskmgt/common/findevs.c | |
parent | e05887f4dd19afc4c565b1a121b48a9b06038831 (diff) | |
parent | 231216303cc2106896aa2c2d6c25a0da912f7593 (diff) | |
download | illumos-joyent-ca7e98efc99f1be718cca849bd004b6d5ca2ce58.tar.gz |
[illumos-gate merge]
commit 231216303cc2106896aa2c2d6c25a0da912f7593
13466 Jan 2021 hwdata update
commit c8be5715fd9a89586c31edc5adb84bad9dcc5a9f
13464 Want pchtemp support for 400 series desktop PCH
13465 Want pchtemp support for Broadwell-U
commit 4955144cafa51275edcbd524ec7401038df30387
13458 bhyve flushes ASID needlessly
commit f85f43ed9f8f93958ca75033d5f390666baa0b6c
13346 diskinfo should identify lofi(7D) devices
Conflicts:
usr/src/lib/libdiskmgt/common/findevs.c
Diffstat (limited to 'usr/src/lib/libdiskmgt/common/findevs.c')
-rw-r--r-- | usr/src/lib/libdiskmgt/common/findevs.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/usr/src/lib/libdiskmgt/common/findevs.c b/usr/src/lib/libdiskmgt/common/findevs.c index 53a0b121fb..9e20eab703 100644 --- a/usr/src/lib/libdiskmgt/common/findevs.c +++ b/usr/src/lib/libdiskmgt/common/findevs.c @@ -28,7 +28,7 @@ * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright 2017 Nexenta Systems, Inc. * Copyright 2017 Joyent, Inc. - * Copyright 2020 Oxide Computer Company + * Copyright 2021 Oxide Computer Company */ #include <fcntl.h> @@ -629,6 +629,28 @@ add_disk2controller(disk_t *diskp, struct search_args *args) return (0); } + /* + * Certain pseudo-device nodes do not all immediately have a valid + * parent-node. In particular, lofi (and zfs) would point to the generic + * /pseudo node. As a result, if we find a lofi disk, redirect it to the + * actual path. If we don't find it in this, then just fall back to the + * traditional path. + */ + if (libdiskmgt_str_eq(di_node_name(pnode), "pseudo") && + libdiskmgt_str_eq(di_node_name(node), "lofi")) { + di_node_t n; + + n = di_drv_first_node("lofi", pnode); + while (n != DI_NODE_NIL) { + if (di_instance(n) == 0) { + pnode = n; + break; + } + + n = di_drv_next_node(n); + } + } + minor = di_minor_next(pnode, NULL); if (minor == NULL) { return (0); @@ -1063,6 +1085,10 @@ ctype(di_node_t node, di_minor_t minor) libdiskmgt_str_eq(name, "xpvd")) return (DM_CTYPE_XEN); + if (libdiskmgt_str_eq(type, DDI_PSEUDO) && + libdiskmgt_str_eq(name, "lofi")) + return (DM_CTYPE_LOFI); + if (dm_debug) { (void) fprintf(stderr, "INFO: unknown controller type=%s name=%s\n", type, name); @@ -1441,6 +1467,11 @@ is_ctrl(di_node_t node, di_minor_t minor) libdiskmgt_str_eq(name, "xpvd"))) return (1); + if (libdiskmgt_str_eq(type, DDI_PSEUDO) && + libdiskmgt_str_eq(name, "lofi") && + libdiskmgt_str_eq(di_minor_name(minor), "ctl")) + return (1); + return (0); } |