summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/parse.y (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert agentx support for now, we're too close to release.martijn2020-09-231-48/+2
| | | | requested by deraadt@
* Add support for agentx to vmd.martijn2020-09-231-2/+48
| | | | | This is based around VM-MIB from RFC7666,but does not export the full spec. People more knowledgeable of vmd are encouraged to expand on this.
* Make owner value mandatorykn2019-12-121-6/+2
| | | | | | | | | | | Omitting the owner value is not documented and ought to be rather invalid syntax, but it parses as "[socket] owner root:wheel" which is the same as simply omitting the owner line entirely. Require a value, that is treat "socket owner" and "owner" as invalid syntax and fail. OK denis
* vmd: start vms defined in vm.conf in a staggered fashionpd2019-12-121-2/+14
| | | | | | | | | | | | This addresses 'thundering herd' problem when a lot of vms are configured in vm.conf. A lot of vms booting in parallel can overload the host and also mess up tsc calibration in openbsd guests as it uses PIT which doesn't fire reliably if the host is overloaded. We default to starting vms with parallelism of ncpuonline and a delay 30 seconds between batches. This is configurable in vm.conf. ok mlarkin@ (also addressed comments from cheloha@)
* Add support for `boot device' to vm.conf grammar which is the `-B device'anton2019-05-141-4/+15
| | | | | | counterpart from vmctl. ok mlarkin@
* track the state of the vm (running, paused, etc) using a single bitfield instead ofjasper2019-05-111-3/+4
| | | | | | | | | a handful of separate variables. this will makes it easier for vmd to report and check on the individual vm states no functional change intended ok ccardenas@ mlarkin@
* (unsigned) means (unsigned int) which on ptrdiff_t or size_t or otherderaadt2019-02-131-3/+3
| | | | | | larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
* Add support for "local inet6" interfaces.reyk2018-11-211-6/+24
| | | | ok & test ccardenas@, additional review from kn@
* - odd condition/test in PF lexersashan2018-11-011-2/+3
| | | | | | | | | | | | | | (and other lexers too) This commit rectifies earlier change: in the lex... even inside quotes, a \ followed by space or tab should expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). OK deraadt@, OK millert@
* The recent switch to realpath(3) for the boot string in vmd(8) brokebluhm2018-10-221-2/+3
| | | | | | vmd-fail-boot-name-too-long regress. Use a relative existing path for this test. Print the error message in vmd config parser. OK ccardenas@ reyk@
* Use realpath(3) on the "boot" config option as well.reyk2018-10-181-4/+10
| | | | | | This fixes code that detects if boot and the first disk are identical. OK mlarkin@
* Try to derive the qcow2 file format from an image file automatically.reyk2018-10-011-8/+36
| | | | | | | | | | | | | | This makes the "-d qcow2:" and "format qcow" arguments optional as vmctl and vmd will read the magic bytes at the beginning of a file to guess if it is a raw or a qcow image file. The "vmctl create" command has been changed by removing the -f qcow2 option and replacing it with the same syntax as -d: "vmctl create qcow2:foo.img". In a slightly ununixy but intended way, the create command now also considers the file extension for the format as "vmctl create foo.qcow2" creates a qcow2 disk and not a raw image file. Ok mlarkin@ (and ccardenas@ on an earlier version of the diff)
* Add initial qcow2 image support.ccardenas2018-09-091-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users are able to declare disk images as 'raw' or 'qcow2' using either vmctl and vm.conf. The default disk image format is 'raw' if not specified. Examples of using disk format: vmctl start bsd -Lc -r cd64.iso -d qcow2:current.qc2 or vmctl start bsd -Lc -r cd64.iso -d raw:current.raw is equivalent to vmctl start bsd -Lc -r cd64.iso -d current.raw in vm.conf vm "current" { disable memory 2G disk "/home/user/vmm/current.qc2" format "qcow2" interface { switch "external" } } or vm "current" { disable memory 2G disk "/home/user/vmm/current.raw" format "raw" interface { switch "external" } } is equivlanet to vm "current" { disable memory 2G disk "/home/user/vmm/current.raw" interface { switch "external" } } Tested by many. Big Thanks to Ori Bernstein.
* replace malloc()+strlcpy() with strndup() in cmdline_symset().miko2018-09-071-9/+4
| | | | "looks good" gilles@ halex@
* Add "allow instance" option.reyk2018-07-131-8/+34
| | | | | | | | | | This allows users to create VM instances and change desired options, for example a user can be allowed to run a VM with all the pre-configured options but specify an own disk image. (mlarkin@ was fine with iterating over it) OK ccardenas@
* Allow to use configured/running VMs as templates for other VM instances.reyk2018-07-121-11/+43
| | | | | | | | | This introduces new grammar and the -t optional in vmctl start. (For now, only root can create VM instances; but it is planned to allow users to create their own VMs based on permissions and quota.) OK ccardenas@ mlarkin@ jmc@
* sort tokensreyk2018-07-111-4/+4
|
* Do for most running out of memory err() what was done for most runningkrw2018-07-111-2/+2
| | | | | | | | out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
* No need to mention which memory allocation entry point failed (malloc,krw2018-07-091-5/+5
| | | | | | | | | calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
* Be consistent in warn() and log_warn() usage whenkrw2018-07-081-3/+3
| | | | | | | | running out of memory. Next step, be correct *and* consistent. ok dennis@ tb@ benno@ schwarze@
* Add "socket owner" to allow changing the owner of the vmd control socket.reyk2018-06-261-2/+8
| | | | | | | | | | | This allows to open vmctl control or console access to other users that are not in group wheel. Access for non-root users still defaults to read-only actions unless you change the owner (user/group) of each individual VM. Requested by Mischa Peters OK mlarkin@
* knfreyk2018-06-191-5/+9
|
* Fix an off-by-one line count when using include statements.denis2018-06-111-47/+78
| | | | | | Thanks to otto@ for the initial diff. OK benno@
* Plug leak in error case of the common 'varset' implementations.krw2018-04-261-1/+3
| | | | ok benno@
* Add initial CD-ROM support to VMD via vioscsi.ccardenas2018-01-031-3/+21
| | | | | | | | | | | | | * Adds 'cdrom' keyword to vm.conf(5) and '-r' to vmctl(8) * Support various sized ISOs (Limitation of 4G ISOs on Linux guests) * Known working guests: OpenBSD (primary), Alpine Linux (primary), CentOS 6 (secondary), Ubuntu 17.10 (secondary). NOTE: Secondary indicates some issue(s) preventing full/reliable functionality outside the scope of the vioscsi work. * If the attached disks are non-bootable (i.e. empty), SeaBIOS (vmd's default BIOS) will boot from CD-ROM. ok mlarkin@, jca@
* update switch handling in vmd(8). vmd now gets switch information (rdomain,mlarkin2017-11-111-18/+1
| | | | | | | | | etc) from underlying switch interface instead of handling this on its own. Diff from carlos cardenas, Thanks! ok reyk@
* vmd no longer creates bridges by default. users should create bridges inmlarkin2017-10-301-6/+9
| | | | | | | /etc/hostname.bridge* files, and specify which bridge to use for a given virtual switch in vm.conf. diff from Carlos Cardenas, thanks
* Add support for rdomains.reyk2017-05-041-2/+19
| | | | | | This allows to configure VM interfaces and switches in individual rdomains. OK mlarkin@
* Sort parser tokens, no functional changereyk2017-05-031-7/+7
|
* Fail if vm.conf exists but cannot be opened, ignore if it doesn't exist.reyk2017-04-211-2/+4
| | | | This fixes 'vmd -nf /etv/vm.conf' if the file is not readable.
* Add global configuration option "local prefix" to change prefix for -L.reyk2017-04-211-2/+60
| | | | | | | The default prefix is 100.64.0.0/10 from RFC6598. Requested by sthen@ chris@ OK mlarkin@
* Add support for dynamic "NAT" interfaces (-L/local interface).reyk2017-04-191-13/+21
| | | | | | | | | | | | | When a local interface is configured, vmd configures a /31 address on the tap(4) interface of the host and provides another IP in the same subnet via DHCP (BOOTP) to the VM. vmd runs an internal BOOTP server that replies with IP, gateway, and DNS addresses to the VM. The built-in server only ever responds to the VM on the inside and cannot leak its DHCP responses to the outside. Thanks to Uwe Werler, Josh Grosse, and some others for testing! OK deraadt@
* "kernel" got renamed to "boot" in vm.conf but I didn't commit the parse.y bits.reyk2017-04-061-4/+4
| | | | | | Found by Pontus Lundkvist OK deraadt
* die whitespace die die diederaadt2017-03-271-3/+3
|
* Add "locked lladdr" option to prevent VMs from spoofing MAC addresses.reyk2017-03-021-9/+20
| | | | | | | This is especially useful when multiple VMs share a switch, the implementation is independent from the underlying switch or bridge. no objections mlarkin@
* Add "owner" option to set a user/group ownership for pre-configured VMsreyk2017-03-011-3/+67
| | | | | | | This allows matching users to start or stop VMs that they "own" and to access the console accordingly. OK mlarkin@
* Make it possible to remove VMs from vmd(8)'s internal queue.edd2017-01-131-1/+2
| | | | | | | | | The semantics agreed with reyk@ are: * ad-hoc created vms, created with `vmctl start`, are removed once stopped. * Stopped VMs defined in a config file are flushed before a `vmctl reload`. OK reyk@
* Replace hand-rolled for(;;) emptying of 'symhead' TAILQ with morekrw2017-01-051-3/+2
| | | | | | | | modern TAILQ_FOREACH_SAFE(). No intentional functional change. ok millert@ bluhm@ gilles@
* Replace symset()'s hand-rolled for(;;) traversal of 'symhead' TAILQkrw2017-01-051-5/+7
| | | | | | | | | | | with more modern TAILQ_FOREACH(). This what symget() was already doing. Add paranoia '{}' around body of symget()'s TAILQ_FOREACH(). No intentional functional change. ok bluhm@ otto@
* Allow to start disabled and pre-configured VMs by name, "vmctl start foo".reyk2016-12-141-1/+7
| | | | | | With testing from Jon Bernard OK mlarkin@
* Insert disabled VMs into vmd(8)'s queues and allow vmctl(8) to display them.edd2016-11-221-7/+7
| | | | | | | | Tested by Jon Bernard and reyk@. OK reyk@, no objections mlarkin@. Thanks
* Pass the internal vmid or 0 to vm_register() instead of changing itreyk2016-11-041-2/+2
| | | | | | once again after setting the next available id. Suggested by edd@
* Update the config/register/get VM methods to match the config_set/getreyk2016-11-041-2/+2
| | | | | | style that is used in other places. Also keep the vmid from the parent. OK edd@
* Simple grammar tweak: allow to specify interface options in a single line.reyk2016-10-291-1/+10
|
* Separate parsing vms and switches from starting them in vmd(8).edd2016-10-291-29/+11
| | | | | | | Brings us one step closer to having disabled by default vms is vm.conf(5), which can be started with vmctl(8). Input, testing and OK reyk@. Thanks.
* Add the option to specify an interface group per virtual switch as well;reyk2016-10-171-1/+9
| | | | | | this group will be added to all VM tap(4) interfaces in the switch. Tested by martijn@
* Allow to add an interface to an interface group; with the group keyword.reyk2016-10-151-2/+17
| | | | Requested and tested by martijn@
* Replace one u_int8_t with uint8_t (finger memory)reyk2016-10-051-2/+2
|
* Add support for enhanced networking configuration and virtual switches.reyk2016-10-051-31/+245
| | | | | | See vm.conf(5) for more details. OK mlarkin@
* do not allow whitespace in macro names, i.e. "this is" = "a variable".benno2016-06-211-1/+9
| | | | | | | | change this in all config parsers in our tree that support macros. problem reported by sven falempin. feedback from henning@, stsp@, deraadt@ ok florian@ mikeb@