ldomctl(8) contains the entire format describing logical domain
configurations loaded with that tool.  This diff entangles control
commands and config options by putting the latter into the appropiate
manual section.

The config options' descriptions stayed the same except where I had to
begin or end sentences anew.

I've converted `Ic =' to `Ns = Ns' and `Ic \&{ ... Ic \&}' to `Brq ...'.

According to CVS history and https://man.openbsd.org, 5.7 was the first
release to describe the config format as part of `init-system file', so
I put that into HISTORY.

There are lots of places that can be improved, but I'd like to do that
in-tree.  Xrs are spread across ldom* manuals, linter is also happy:

        $ mandoc -Tlint ../ldomctl/ldomctl.8 ./ldom.conf.5
        $

I have not added my copyright and did not add myself to AUTHORS because
that split in itself does not have any original value imho,  but I think
we should add stsp as he initially documented the format and added the
examples in ldomctl.8 revision 1.7.

Feedback? OK?

Index: usr.sbin/ldomctl/ldomctl.8
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/ldomctl.8,v
retrieving revision 1.11
diff -u -p -r1.11 ldomctl.8
--- usr.sbin/ldomctl/ldomctl.8  16 Sep 2018 14:27:32 -0000      1.11
+++ usr.sbin/ldomctl/ldomctl.8  27 Jul 2019 01:25:36 -0000
@@ -50,50 +50,11 @@ The download is aborted if a configurati
 Dump the current configuration from non-volatile storage into the current
 working directory.
 .It Cm init-system Ar file
-Generates files describing a logical domain configuration.
-The generated files are written to the current working directory.
-The provided
+Generate files in the current working directory for a logical domain
+configuration
 .Ar file
-describes resources assigned to logical domains in a plain text format
-with the following syntax:
-.Bl -tag -width Ds
-.It Ic domain Ar name Ic \&{ Ar resource ... Ic \&}
-Declares a scope for resources assigned to the specified domain.
-The scope must be opened and closed with curly braces and contains
-one or more of the following keywords, each on a separate line.
-A scope with
-.Ar name
-"primary" configures resources for the primary domain.
-If no configuration for the primary domain exists it is assigned
-all CPU and memory resources not used by any guest domains.
-.It Ic vcpu Ar number
-Declares the number of virtual CPUs assigned to a domain.
-.It Ic memory Ar number Ns Op Ar unit
-Declares the amount of memory assigned to a domain, in bytes.
-Optionally, the units 'K', 'M', or 'G', for kilo-, mega-, and gigabytes
-can be used.
-.It Ic variable Ar name Ic = Ar value
-Sets the specified NVRAM variable for the domain.
-.It Ic vdisk Ar file
-The specified file is used to back a virtual disk of the guest
-domain.
-.Ar file
-can be a block device node or a disk image file created with
-.Xr dd 1 .
-This keyword can be used multiple times.
-.It Ic vnet Op Ic \&{ Ar keyword Ic = Ar value ... Ic \&}
-Assign a
-.Xr vnet 4
-network interface to the guest domain.
-This keyword can be used multiple times.
-The curly braces are optional and can contain the following keywords:
-.Bl -tag -width Ds
-.It Ic mac-addr Ar address
-Configures the MAC address of the interface.
-.It Ic mtu Ar number
-Configures the MTU of the interface.
-.El
-.El
+as described in
+.Xr ldom.conf 5 .
 .It Cm list
 List configurations stored in non-volatile storage.
 Indicate the currently running configuration,
@@ -135,25 +96,8 @@ Create a new configuration based on the 
 # cd openbsd
 .Ed
 .Pp
-A file describing the desired configuration must be created:
-.Bd -literal -offset indent
-# cat ldom.conf
-domain puffy {
-       vcpu 12
-       memory 4G
-       vdisk "/home/puffy/vdisk0"
-       vdisk "/home/puffy/vdisk1"
-       vnet
-}
-
-domain salmah {
-       vcpu 8
-       memory 2G
-       vdisk "/home/salmah/vdisk0"
-       vdisk "/home/salmah/vdisk1"
-       vnet
-}
-.Ed
+A file describing the desired configuration must be created, see
+Xr. ldom.conf 5 .
 .Pp
 Generate a set of configuration files and download to non-volatile storage.
 If a configuration with the same name already exists, it must be removed first:
@@ -223,6 +167,7 @@ ok boot disk1
 .Xr dd 1 ,
 .Xr ddb 4 ,
 .Xr vnet 4 ,
+.Xr ldom.conf 5 ,
 .Xr ldomd 8
 .Sh HISTORY
 The
Index: usr.sbin/ldomd/Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/ldomd/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- usr.sbin/ldomd/Makefile     27 Oct 2012 20:03:24 -0000      1.3
+++ usr.sbin/ldomd/Makefile     27 Jul 2019 01:25:36 -0000
@@ -16,7 +16,7 @@ NOPROG=       yes
 
 .endif
 
-MAN=   ldomd.8
+MAN=   ldomd.8 ldom.conf.5
 MANSUBDIR=sparc64
 
 .include <bsd.prog.mk>
Index: usr.sbin/ldomd/ldom.conf.5
===================================================================
RCS file: usr.sbin/ldomd/ldom.conf.5
diff -N usr.sbin/ldomd/ldom.conf.5
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ usr.sbin/ldomd/ldom.conf.5  27 Jul 2019 01:25:36 -0000
@@ -0,0 +1,103 @@
+.\" $OpenBSD: $
+.\"
+.\" Copyright (c) 2012 Mark Kettenis <kette...@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: Jul 28 2019 $
+.Dt LDOM.CONF 5 sparc64
+.Os
+.Sh NAME
+.Nm ldom.conf
+.Nd Logical Domain configuration
+.Sh DESCRIPTION
+.Nm
+is the configuration file to configure logical domains.
+.Pp
+Domains are defined in following format:
+.Bl -tag -width Ds
+.It Ic domain Ar name Brq ...
+Declares a scope for resources assigned to the specified domain.
+The scope must be opened and closed with curly braces and contains
+one or more of the following keywords, each on a separate line.
+A scope with
+.Ar name
+"primary" configures resources for the primary domain.
+If no configuration for the primary domain exists it is assigned
+all CPU and memory resources not used by any guest domains.
+.It Ic vcpu Ar number
+Declares the number of virtual CPUs assigned to a domain.
+.It Ic memory Ar number Ns Op Ar unit
+Declares the amount of memory assigned to a domain, in bytes.
+Optionally, the units 'K', 'M', or 'G', for kilo-, mega-, and gigabytes
+can be used.
+.It Ic variable Ar name Ns = Ns Ar value
+Sets the specified NVRAM variable for the domain.
+.It Ic vdisk Ar file
+The specified file is used to back a virtual disk of the guest
+domain.
+.Ar file
+can be a block device node or a disk image file created with
+.Xr dd 1 .
+This keyword can be used multiple times.
+.It Ic vnet Op Brq Ar keyword Ns = Ns Ar value ...
+Assign a
+.Xr vnet 4
+network interface to the guest domain.
+This keyword can be used multiple times.
+The curly braces are optional and can contain the following keywords:
+.Bl -tag -width Ds
+.It Ic mac-addr Ar address
+Configures the MAC address of the interface.
+.It Ic mtu Ar number
+Configures the MTU of the interface.
+.El
+.El
+.Sh EXAMPLES
+Define a domain with 12 virtual cores, 1GB memory, two file based virtual disks
+and one virtual network interface:
+.Bd -literal -offset indent
+domain "puffy" {
+       vcpu 12
+       memory 4G
+       vdisk "/home/puffy/vdisk0"
+       vdisk "/home/puffy/vdisk1"
+       vnet
+}
+.Ed
+.Pp
+Define another one with slightly less resources:
+.Bd -literal -offset indent
+domain "salmah" {
+       vcpu 8
+       memory 2G
+       vdisk "/home/salmah/vdisk0"
+       vdisk "/home/salmah/vdisk1"
+       vnet
+}
+.Ed
+.Pp
+On a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
+58GB memory to the primary domain.
+.Sh SEE ALSO
+.Xr ldomctl 8 ,
+.Xr ldomd 8
+.Sh HISTORY
+The
+.Nm
+file format first appeared in
+.Ox 5.7
+as part of
+.Xr ldomctl 8 .
+It was split into this manual page in
+.Ox 6.6 .
Index: usr.sbin/ldomd/ldomd.8
===================================================================
RCS file: /cvs/src/usr.sbin/ldomd/ldomd.8,v
retrieving revision 1.5
diff -u -p -r1.5 ldomd.8
--- usr.sbin/ldomd/ldomd.8      11 Jul 2019 05:42:41 -0000      1.5
+++ usr.sbin/ldomd/ldomd.8      27 Jul 2019 01:25:36 -0000
@@ -43,6 +43,7 @@ will run in the foreground and log to
 .El
 .Sh SEE ALSO
 .Xr vldc 4 ,
+.Xr ldom.conf 5 ,
 .Xr ldomctl 8
 .Sh HISTORY
 The

Reply via email to