summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/config.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Make error handling in config_getvm() more robuststefan2016-09-031-15/+62
| | | | | | | | | | | Open all fds first before sending messages to the vmm process. This prevents some intermediate state from being generated that will confuse vmm if it gets further messages. Also make sure that vmctl gets the right error reason later by saving errno upon a failure. ok reyk@ mlarkin@
* Allow starting a VM again after it was terminatedstefan2016-07-291-1/+2
| | | | | | | | | | | If a VM exits, terminate it and remove it from the list of available VMs. That allows a VM with name `foo' to be restarted after it has exited. This changes structures shared between vmd and vmctl. You need to rebuild vmctl also. ok mlarkin@
* Only increment the vm counter after successfully adding a new vm; thereyk2015-12-071-2/+3
| | | | | counter has to be in sync in the parent and vmm processes. This fixes reload after a previous load error.
* Fix error handling in a few cases: some function return (-1) on error,reyk2015-12-071-4/+12
| | | | | while others return (errno) on error. We probably have to agree on something.
* Prevent running a VM with the same name multiple times - multiplereyk2015-12-061-1/+6
| | | | | | | | instances of the same configuration will be handled in a different way later. It is also not a good idea to use the same writeable disk with multiple VMs at the same time. As discussed with mlarkin@
* Report errno from config_getvm() correctlyreyk2015-12-061-6/+11
|
* A VM has to run with at least 1 CPU.reyk2015-12-041-1/+3
|
* Re-add the "load" and "reload" commands to vmctl: Instead of parsingreyk2015-12-031-6/+5
| | | | | | | | 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.
* Add support for an optional vm.conf(5) file in vmd. This will replacereyk2015-12-031-3/+1
| | | | | | | vmm.conf(5) in vmmctl. For a short time, both vmd and vmmctl will support a configuration file, but vmmctl will be changed to send "load" requests to vmd instead of loading and parsing the file directly.
* prepare config_getvm() for parse.yreyk2015-12-031-24/+21
|
* Split the fully privileged parent into two processes "parent" andreyk2015-12-021-0/+251
"vmm" with reduced privileges: - the "parent" opens fds (disks, ifs, etc.) but runs as root but pledged as "stdio rpath wpath proc tty sendfd". - the "vmm" process handles the creation and supervision of vm processes, and the primary communication with the vmm(4) subsystem. It runs as _vmd in the chroot but does not use pledge, as the vmm ioctls are not allowed by any pledge model yet. With this change, vmd starts to track the configuration state of VMs in vmd and will allow other things later (like terminating a vm by name, moving the configuration parser to vmd, ...). More incremental changes will follow.