summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/config.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-12-03 23:32:33 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-12-03 23:32:33 +0000
commit8807054e2779e04ad0d47023071e6de67b318fdc (patch)
tree7146c1df1206c29cc3862dadfeb491231359a2ac /usr.sbin/vmd/config.c
parent393c2127ea1d235eff95309344dbbb306b61410c (diff)
Re-add the "load" and "reload" commands to vmctl: Instead of parsing
the configuration in vmctl directly, it now sends a (re)load request to vmd. The reload also resets the existing configuration status - this doesn't do much difference yet but a future change will compare if a specified VM is already running. "load" will allow to add configuration, while "reload" resets the state before loading.
Diffstat (limited to 'usr.sbin/vmd/config.c')
-rw-r--r--usr.sbin/vmd/config.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/vmd/config.c b/usr.sbin/vmd/config.c
index d835ed88f6d..b5cf51786ab 100644
--- a/usr.sbin/vmd/config.c
+++ b/usr.sbin/vmd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.3 2015/12/03 16:11:32 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.4 2015/12/03 23:32:32 reyk Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -38,7 +38,7 @@ int
config_init(struct vmd *env)
{
struct privsep *ps = &env->vmd_ps;
- u_int what;
+ unsigned int what;
/* Global configuration */
if (privsep_process == PROC_PARENT) {
@@ -58,14 +58,13 @@ config_init(struct vmd *env)
}
void
-config_purge(struct vmd *env, u_int reset)
+config_purge(struct vmd *env, unsigned int reset)
{
struct privsep *ps = &env->vmd_ps;
struct vmd_vm *vm;
- u_int what;
+ unsigned int what;
what = ps->ps_what[privsep_process] & reset;
-
if (what & CONFIG_VMS && env->vmd_vms != NULL) {
while ((vm = TAILQ_FIRST(env->vmd_vms)) != NULL)
vm_remove(vm);
@@ -74,7 +73,7 @@ config_purge(struct vmd *env, u_int reset)
}
int
-config_setreset(struct vmd *env, u_int reset)
+config_setreset(struct vmd *env, unsigned int reset)
{
struct privsep *ps = &env->vmd_ps;
unsigned int id;