Re: ldomctl.8: split config into new ldom.conf.5

2019-07-27 Thread Matthieu Herrb
On Sat, Jul 27, 2019 at 03:30:53AM +0200, Klemens Nanni wrote:
> 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 -  1.3
> +++ usr.sbin/ldomd/Makefile   27 Jul 2019 01:25:36 -
> @@ -16,7 +16,7 @@ NOPROG= yes
>  
>  .endif
>  
> -MAN= ldomd.8
> +MAN= ldomd.8 ldom.conf.5
>  MANSUBDIR=sparc64
>  
>  .include 

Here on amd64 this breaks the build:

install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldomd.8 
/usr/share/man/man8/sparc64/ldomd.8
install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldom.conf.5 
/usr/share/man/man5/sparc64/ldom.conf.5
install: /usr/share/man/man5/sparc64/INS@uuYbA85wgn: No such file or directory
*** Error 1 in /share/OpenBSD/src/usr.sbin/ldomd (:35 
'/usr/share/man/man5/sparc64/ldom.conf.5')

-- 
Matthieu Herrb



ldomctl.8: split config into new ldom.conf.5

2019-07-26 Thread Klemens Nanni
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 -  1.11
+++ usr.sbin/ldomctl/ldomctl.8  27 Jul 2019 01:25:36 -
@@ -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 -  1.3
+++ usr.sbin/ldomd/Makefile 27 Jul 2019 01:25:36 -
@@ -16,7 +16,7 @@ NOPROG=   yes
 
 .endif
 
-MAN=   ldomd.8
+MAN=   ldomd.8 ldom.conf.5
 MANSUBDIR=sparc64
 
 .include 
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