diff options
-rw-r--r-- | usr.sbin/vmd/vmd.8 | 37 | ||||
-rw-r--r-- | usr.sbin/vmd/vmd.c | 12 |
2 files changed, 43 insertions, 6 deletions
diff --git a/usr.sbin/vmd/vmd.8 b/usr.sbin/vmd/vmd.8 index 367a12734a1..95d0a684af1 100644 --- a/usr.sbin/vmd/vmd.8 +++ b/usr.sbin/vmd/vmd.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vmd.8,v 1.3 2015/11/23 13:04:49 reyk Exp $ +.\" $OpenBSD: vmd.8,v 1.4 2015/12/03 16:18:13 reyk Exp $ .\" .\" Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 23 2015 $ +.Dd $Mdocdate: December 3 2015 $ .Dt VMD 8 .Os .Sh NAME @@ -22,7 +22,9 @@ .Nd virtual machine daemon .Sh SYNOPSIS .Nm vmd -.Op Fl dv +.Op Fl dnv +.Op Fl D Ar macro Ns = Ns Ar value +.Op Fl f Ar file .Sh DESCRIPTION .Nm is a daemon responsible for the execution of virtual machines (VMs) on a @@ -58,17 +60,44 @@ about running VMs. .Pp The options are as follows: .Bl -tag -width Dssmacro=value +.It Fl D Ar macro Ns = Ns Ar value +Define +.Ar macro +to be set to +.Ar value +on the command line. +Overrides the definition of +.Ar macro +in the configuration file. .It Fl d Do not daemonize and log to .Em stderr . +.It Fl f Ar file +Specify an alternative configuration file. +The default is +.Pa /etc/vm.conf . +.It Fl n +Configtest mode. +Only check the configuration file for validity. .It Fl v Verbose mode. Multiple .Fl v options increases the verbosity. .El +.Sh FILES +.Bl -tag -width "/var/run/vmd.sockXX" -compact +.It Pa /etc/vm.conf +Default configuration file. +This is optional. +.It Pa /var/run/vmd.sock +.Ux Ns -domain +socket used for communication with +.Xr vmmctl 8 . +.El .Sh SEE ALSO .Xr vmm 4 , +.Xr vm.conf 5 , .Xr rc.conf 8 , .Xr vmmctl 8 .Sh HISTORY @@ -78,3 +107,5 @@ command first appeared in .Ox 5.9 . .Sh AUTHORS .An Mike Larkin Aq Mt mlarkin@openbsd.org +and +.An Reyk Floeter Aq Mt reyk@openbsd.org diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 2d936a8e843..cbf65513c1d 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.14 2015/12/03 16:13:04 reyk Exp $ */ +/* $OpenBSD: vmd.c,v 1.15 2015/12/03 16:18:13 reyk Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -215,7 +215,8 @@ __dead void usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-dv]\n", __progname); + fprintf(stderr, "usage: %s [-dnv] [-D macro=value] [-f file]\n", + __progname); exit(1); } @@ -229,8 +230,13 @@ main(int argc, char **argv) if ((env = calloc(1, sizeof(*env))) == NULL) fatal("calloc: env"); - while ((ch = getopt(argc, argv, "df:vn")) != -1) { + while ((ch = getopt(argc, argv, "D:df:vn")) != -1) { switch (ch) { + case 'D': + if (cmdline_symset(optarg) < 0) + log_warnx("could not parse macro definition %s", + optarg); + break; case 'd': env->vmd_debug = 2; break; |