Now that `ldomctl console ...' is implemented there is actually no need
to print the device any longer, it is an implementation detail that
should be hidden just like it is the case with vmctl.
That also makes it fit nicely on serial consoles again.
$ doas ldomctl status primary
primary - running OpenBSD running
1%
$ jot -s '' -b . 72
........................................................................
$ doas obj/ldomctl status primary
primary running OpenBSD running 0%
OK?
Index: ldomctl.8
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/ldomctl.8,v
retrieving revision 1.20
diff -u -p -r1.20 ldomctl.8
--- ldomctl.8 6 Dec 2019 23:01:03 -0000 1.20
+++ ldomctl.8 30 Dec 2019 00:13:06 -0000
@@ -162,9 +162,9 @@ The primary domain should have less CPUs
are now assigned to the guest domains:
.Bd -literal -offset indent
# ldomctl status
-primary - running OpenBSD running 1%
-puffy ttyV0 running OpenBoot Primary Boot Loader 8%
-salmah ttyV1 running OpenBoot Primary Boot Loader 12%
+primary running OpenBSD running 1%
+puffy running OpenBoot Primary Boot Loader 8%
+salmah running OpenBoot Primary Boot Loader 12%
.Ed
.Pp
Configure the
Index: ldomctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/ldomctl.c,v
retrieving revision 1.31
diff -u -p -r1.31 ldomctl.c
--- ldomctl.c 28 Dec 2019 18:36:02 -0000 1.31
+++ ldomctl.c 30 Dec 2019 00:12:02 -0000
@@ -509,7 +509,6 @@ guest_status(int argc, char **argv)
double utilisation = 0.0;
const char *state_str;
char buf[32];
- char console_str[8] = "-";
if (argc < 1 || argc > 2)
usage();
@@ -610,14 +609,8 @@ guest_status(int argc, char **argv)
break;
}
- /* primary has no console */
- if (guest->gid != 0) {
- snprintf(console_str, sizeof(console_str),
- "ttyV%llu", guest->gid - 1);
- }
-
- printf("%-16s %-8s %-16s %-32s %3.0f%%\n", guest->name,
- console_str, state_str, state.state == GUEST_STATE_NORMAL ?
+ printf("%-16s %-16s %-32s %3.0f%%\n", guest->name,
+ state_str, state.state == GUEST_STATE_NORMAL ?
softstate.soft_state_str : "-", utilisation);
}
}