summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-03-17 21:24:23 +0000
committerkn <kn@cvs.openbsd.org>2020-03-17 21:24:23 +0000
commit1f8d50b33bcce07fce5efb97451a0e13f0a7b9e1 (patch)
treee361645d2c51fa7e9f79cace2a8792f1b2afd860 /usr.sbin
parentb86540b669f3e247f57a7a8658c007265c39085a (diff)
Print IO device names next to path with "list-io"
Names help identify the right iodevice to be assigned in ldom.conf(5); they directly match the structure seen in the iLOM shell, and the output format is similar to Solaris "ldm list-io". OK kettenis
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ldomctl/config.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/ldomctl/config.c b/usr.sbin/ldomctl/config.c
index 4b347fcad32..8c5486da04f 100644
--- a/usr.sbin/ldomctl/config.c
+++ b/usr.sbin/ldomctl/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.35 2020/03/07 18:51:06 kn Exp $ */
+/* $OpenBSD: config.c,v 1.36 2020/03/17 21:24:22 kn Exp $ */
/*
* Copyright (c) 2012, 2018 Mark Kettenis
@@ -48,6 +48,7 @@ TAILQ_HEAD(, core) cores;
struct component {
const char *path;
+ const char *nac;
int assigned;
struct md_node *hv_node;
@@ -216,6 +217,7 @@ pri_init_components(struct md *md)
struct component *component;
struct md_node *node;
const char *path;
+ const char *nac;
const char *type;
TAILQ_INIT(&components);
@@ -228,6 +230,10 @@ pri_init_components(struct md *md)
if (md_get_prop_str(md, node, "assignable-path", &path)) {
component = xzalloc(sizeof(*component));
component->path = path;
+ if (md_get_prop_str(md, node, "nac", &nac))
+ component->nac = nac;
+ else
+ component->nac = "-";
TAILQ_INSERT_TAIL(&components, component, link);
}
@@ -2889,7 +2895,8 @@ list_components(void)
pri_init_components(pri);
+ printf("%-16s %s\n", "PATH", "NAME");
TAILQ_FOREACH(component, &components, link) {
- printf("%s\n", component->path);
+ printf("%-16s %s\n", component->path, component->nac);
}
}