IABSD.fr/src/usr.sbin/vmctl

Branch :


Log

Author Commit Date CI Message
8afcfef5 2020-03-11 12:47:49 fix spelling of IMSG_VMDOP_TERMINATE_VM_RESPONSE in comment from Matt Schultz
7e8e6f43 2020-02-16 11:03:25 Backout "DHCP is configured on the first interface only" I completely missed that part from vmctl.5's "LOCAL INTERFACES" section. Reading `-L's description itself and the fact that it functions as a boolean switch contrary to how `-i' expects a number, I made the wrong assumption that it can only work for the first interface. "vmctl -Li2" configures two interfaces, one witch DHCP and one without. "vmctl -L -L" however configures two interfaces with DHCP IPs each. My second mistake was to imply analogue behaviour for the configuration. Now that you stated the obvious about `local' being per `interface' line, it makes absoloutely no sense to above mentioned behaviour for static VM definitions. Pointed out by tb
29504faa 2020-02-15 21:03:18 DHCP is configured on the first interface only A VM can have multiple interfaces, but only the first one gets DHCP if "-L" (vmctl) or "local" (vm.conf) is specified. Positive feedback Mike Larkin
0410d4ed 2020-01-03 05:32:00 vmctl(8): fix vmctl send exit code vmctl send always returned exit code 1 Patch by Benjamin Baier ok kn@
5154e7dc 2019-12-28 18:36:01 Run cu(1) in restricted mode Users must not not be able to transfer files from the local hypervisor filesystem to VMs/LDOMs, especially since the "vmctl/ldomctl console ..." might be run as root. Disable all relevant escape sequences and cause cu to run under "stdio tty" pledge by using -r. OK deraadt mlarkin
4a2cfa82 2019-12-17 09:43:00 Use local variable isntead of function parameter The parse_size() wrapper around scan_scaled(3) writes its intermediate result to the function argument which is always passed as literal zero. This seems odd, the function parameter has no meaning but merely serves as storage, so let's use a proper function scoped variable instead. OK pd
12d482ab 2019-12-15 14:36:59 Explicitly print root user in status OWNER column With "owner root:wheel" (any group) the status output prints ":wheel" only, presumably to emphasize that only group membership matters. Always print whatever is configured to be explicit and less confusing. OK jasper
de12a377 2019-12-12 03:53:38 vmd: start vms defined in vm.conf in a staggered fashion 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@)
0f0fb1d3 2019-10-27 08:59:48 Require at least one interface with -i Either a positive count is given or -i is omitted entirely; vm.conf(5) does not allow interface configuration that results in zero interfaces either. Raise the minimium count value to one and tell more about invalid counts with the usual strtonum(3) idiom. OK reyk
b2b2ce5f 2019-09-15 12:06:20 Use (egress) in nat-to example Without parentheses, this rule evaluates to the static list of addresses at loadtime; this can be a problem when the machine's network is not fully established when pf.conf is loaded. From pf.conf(5): When the interface name is surrounded by parentheses, the rule is automatically updated whenever the interface changes its address. The ruleset does not need to be reloaded. This is especially useful with NAT. This syncs vmctl(8) with the VMM FAQ. Pointed out by Matthias Schmidt, thanks!
083b9ea2 2019-09-07 09:11:14 Remove unused VMD_DISK_INVALID message type and mark it obsolete. ok mlarkin@
f460dd9f 2019-08-23 07:55:20 vmctl(8): fix wrong output when using 'vmctl stop' Fix a wrong output when using 'vmctl stop' without any further arguments. Patch from Caspar Schutijser, thanks! ok deraadt
baf88fe3 2019-08-14 07:34:49 Improve the error message when supplying an invalid template to vmctl start. Favoring 'invalid template' over 'permission denied' should give the user a better hint on what went wrong. ok kn@ mlarkin@
edd77514 2019-08-08 20:37:08 Fix a bunch of typos in various man pages.
3b75a7b9 2019-07-05 22:22:40 zap an extra space in usage(); from alessandro gallo
484a4d71 2019-05-31 23:12:08 zap trailing whitespace;
bd4b76f8 2019-05-29 21:32:43 Change vmctl(8) syntax: command options before the disk/name/id argument. vmctl had a CLI-style syntax (bgpctl-style) for a short time but I changed it back to a more suitable getopt syntax. I replaced the CLI tokens to getopts flags but didn't consider swapping the order of command options and arguments to be more UNIX-like again ("vmctl create disk.img size 10G" simply became "vmctl create disk.img -s 10G"). This changes "create", "start", and "stop" commands to the commonly expected syntax like "vmctl create -s 10G disk.img". Requested by many OK mlarkin@ kn@ solene@
8f40ce4b 2019-05-22 16:19:21 re-order to reported states based on order of significance: paused takes priority over running; running takes priority over disabled ok mlarkin@ pd@
1f00b87e 2019-05-16 06:41:47 treat vms that are disabled in vm.conf the same as any other vm that's stopped "disabled" in this context might imply it being broken or otherwise unusable prompted by and ok mlarkin@
50ed37b0 2019-05-14 12:47:17 Delete some .Sx macros that were used in a wrong way. Part of a patch from Stephen Gregoratto <dev at sgregoratto dot me>.
3f77225d 2019-05-11 23:07:46 report vm state through 'vmctl status'; whereas previously this would display the state of the vcpu (which is why it got removed), it now actually reports the correct state (running, stopped, disabled, paused, etc) ok ccardenas@ mlarkin@
d84214ae 2019-05-10 18:11:27 remove receive_vm prototype for the function does not exist (anymore) ok pd@
b95d8a09 2019-05-06 05:40:49 double macro snuck in;
e3c47f97 2019-05-06 03:27:54 vmctl.8 : man page cleanup input from jmc@
628e8b46 2019-04-02 03:58:57 Report reliable VM state on status command `vmctl status id' reports the VM's VCPU states, that is whether they are running or halted. Given that only one VCPU is currently supported per VM and the undocumented states change across repetitive status commands, change it to indicate the VM's general state based on whether the respective host procces is running or not. This makes vmctl reliably report "STATE: RUNNING" and "STATE: STOPPED" for started and stopped VMs respectively. OK mlarkin
26212166 2019-03-18 21:00:09 Consistently use imperative present tense throughout the manual Feedback and OK jmc
e6d0a5bd 2019-03-18 20:27:12 An existing VM may be started by referencing its ID Document `vmctl start id ...' again but be clear about the difference between starting new and existing VMs by name and ID respectively. This completes what I started with vmctl.8 revision 1.61. Feedback and OK jmc
f34f2a88 2019-03-07 18:54:05 Clarify that VM names must start with a letter `start' requires an alphanumeric VM name, must not be a number and in fact must not start with a digit. Improve and simplify the current requirements as starting with a letter directly implies all of the above. OK mlarkin, feedback jmc
c1e58e1a 2019-03-01 12:47:36 Fix previous extra arguments commit I blatantly missed the argc/argv adjustments after getopt(3), resulting in valid commands like `vmctl create a -s 1G' to fail. Noticed by ajacoutot the hard way. OK ajacoutot jca
b0b31ffc 2019-03-01 10:34:14 Print usage on extra create, start and stop arguments OK mlarkin
bbbb23fd 2019-01-18 01:24:07 disable vmd/vmctl for i386 Next commit will delete vmm(4) for i386. Reasons to delete i386 vmm: - Been broken for a while, almost no one complained. - Had been falling out of sync from amd64 while it worked. - If your machine has vmx, you most probably can run amd64, so why not run that? ok mlarkin@ deraadt@
aaf1d71d 2018-12-18 08:04:58 show log/reset/stop as single commands, like usage() currently does; ok mlarkin claudio
cb84e044 2018-12-14 07:56:17 sync usage(); also, stop enclosing arg names in quotes, since it was applied inconsistently, and applied consistently would make it look like spaghetti; ok mlarkin
3b3650f0 2018-12-13 06:51:52 various minor tweaks; ok mlarkin
bdbc1844 2018-12-11 07:44:25 Extend vmctl start -B argument to work for disk, cdrom and net. Currently SeaBIOS will respect disk and cdrom and our kernel will understand net. OK ccardenas@, reyk@, mlarkin@
696945d5 2018-12-07 21:59:57 zap trailing whitespace
917458a3 2018-12-06 09:23:15 Add a new argument -B device to vmctl start. It allows to set the boot device. At the moment only 'net' is supported and all other values are silently ignored. This allows to kick of an OpenBSD autoinstall by using: vmctl start "installer" -Lc -B net -b bsd.rd -d disk.img OK ccardenas@
583f6618 2018-12-04 08:17:17 Add 'vmctl wait <VM>' a command that waits until the specified VM is stopped/terminates. Useful in scripts when waiting until a vm has finished its work. Ok ccardenas@, reyk@
62df93ee 2018-11-26 10:39:30 Move the {qcow2,raw} create functions from vmctl into vmd/vio{qcow2,raw}.c This way they are in the appropriate place and code can be shared with vmd. Ok ori@ mlarkin@ ccardenas@
4df30e3e 2018-11-20 12:48:16 DNS goes over both udp and tcp, so reflect that in example pf.conf line; ok reyk@
24235575 2018-10-20 13:29:12 remove unneccessary macros;
4d2a1fb2 2018-10-19 10:12:39 Add support to create and convert disk images from existing images The -i option to vmctl create (eg. vmctl create output.qcow2 -i input.img) lets you create a new image from an input file and convert it if it is a different format. This allows to convert qcow2 images from raw images, raw from qcow2, or even qcow2 from qcow2 and raw from raw to re-optimize the disk. This re-uses Ori's vioqcow2.c from vmd by reaching into it and compiling it in. The API has been adjust to be used from both vmctl and vmd accordingly. OK mlarkin@
73613953 2018-10-08 16:32:01 Add support for qcow2 base images (external snapshots). This works is from Ori Bernstein, committing on his behalf: Add support to vmd for external snapshots. That is, snapshots that are derived from a base image. Data lookups start in the derived image, and if the derived image does not contain some data, the search proceeds ot the base image. Multiple derived images may exist off of a single base image. A limitation of this format is that modifying the base image will corrupt the derived image. This change also adds support for creating disk derived disk images to vmctl. To use it: vmctl create derived.qcow2 -s 16G -b base.qcow2 From Ori Bernstein OK mlarkin@ reyk@
8ff019a1 2018-10-05 12:54:57 Setting getopt optreset to 1 needs an additional reset of optind to 1. OK millert@
31607d49 2018-10-02 16:42:38 Fix potential rounding errors when calculating the qcow2 l1 and ref tables sizes OK ccardenas@ mlarkin@
e2ceadc1 2018-10-01 09:31:15 Try to derive the qcow2 file format from an image file automatically. 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)
e0b12962 2018-09-27 17:15:36 Add vmctl stop -a [-fw] option to stop or terminate all running VMs. This is also be used to simplify the vmd rc stop script. OK mlarkin@ ccardenas@
f7995b2c 2018-09-21 14:04:37 Add explanations about vmctl send command ok jmc@ jca@ mlarkin@ mdoc tip from bentley@
dee31871 2018-09-16 02:43:11 Use user_from_uid(3) and group_from_gid(3) in a few more places that do repeated lookups. OK tb@
6955bc4d 2018-09-13 03:53:33 Add initial set of unveil's to vmctl. Was in snaps for a while. Ok mlarkin@ and reyk@
5f3f4152 2018-09-11 04:03:16 Add ability to create qcow2 disk. vmctl create now takes an optional disk format parameter: raw or qcow2. If format is omitted, raw is used. Many thanks to Ori Bernstein.
3eaf3887 2018-09-09 06:36:43 tweak previous;
f224f92a 2018-09-09 04:09:32 Add initial qcow2 image support. 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.
d9672895 2018-08-23 06:04:53 Allow to boot CDROM-only VMs. Pointed out by Jon Williams OK mlarkin@ kn@ ccardenas@
2fa5a6a3 2018-07-29 14:11:05 add missing markup and some minor tweaks; ok jmc@
508a6e39 2018-07-12 14:53:37 The vmctl start -I option was changed to -t. I committed the manpage but accidentally forgot the main.c part. OK ccardenas@
6429e633 2018-07-12 12:04:49 Allow to use configured/running VMs as templates for other VM instances. 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@
eab0cc3b 2018-07-11 21:29:05 check string lengths in vm_start
23cebd36 2018-07-11 17:21:57 remove useless macro;
3be9785f 2018-07-11 13:19:47 Add -w option to vmctl stop to wait for completion of VM termination. Use it in /etc/rc.d/vmd accordingly. OK sthen@
f6e5c9eb 2018-07-11 09:35:44 Add -f option to vmctl stop to forcefully kill a VM. This also fixes a bug in vmm_sighdlr where it might have missed forwarding the TERMINATE_EVENT to the vmd parent after a VM child died, leading to an abandoned VM in the vmd parent process. OK ccardenas@ mlarkin@ benno@ kn@
574a6dcb 2018-07-04 02:55:37 When a VM stop request fails, set errno prior to calling warn() in order to display the correct error message. This is a pattern found elsewhere in vmctl. With input from deraadt@ and encouraged by mlarkin@
6d26286f 2018-06-19 17:13:50 knf
8c340e5d 2018-03-14 07:29:34 block two VMs from using the same disk image file at the same time. Also changes an error message in vmctl to reflect same.
a8df2bc2 2018-03-14 07:07:44 knf
5fd19063 2018-02-26 06:36:53 vmctl: clarify console error message Clear up ambiguous error message when attaching to a console fails as the vm id is not guaranteed to be populated. ok mlarkin@
96f2cfcb 2018-02-24 13:14:09 sort;
8c44bfca 2018-02-24 10:39:35 add an alias for vmctl show, matches finger memory and the rest of the *ctl programs OK mlarkin@ benno@ deraadt@
c8fb8957 2018-01-03 08:17:18 pretty up the "start" command;
95ab188f 2018-01-03 05:39:56 Add initial CD-ROM support to VMD via vioscsi. * 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@
610f4e31 2017-11-05 20:01:09 Add minimal DHCP support to vmd's built-in DHCP/BOOTP server. This fixes "local interface" mode with the udhcpc client. udhcpc, a DHCP client that is used by busybox and many embedded Linux distributions, does not support BOOTP which is the predecessor and a valid subset of DHCP. OK mlarkin@, Carlos Cardenas
5eaf1adb 2017-10-07 19:48:30 Prefer memset() over bzero() ok deraadt@ mlarkin@
2da5c9db 2017-09-08 07:08:49 better VM termination handling. diff provided by Carlos Cardenas, thanks
a3f50fa8 2017-09-08 06:43:47 vmctl: style cleanup - spaces vs tabs. Noticed by Carlos Cardenas
db16494f 2017-09-05 22:06:49 Detail how VM guests acquire a nameserver for local interfaces. OK mlarkin@, krw@. Thanks!
0f032bd5 2017-09-01 03:37:35 vmctl: -L option clarification in man page
016c06c1 2017-08-31 09:15:31 vmctl: change a feedback message displayed to the user from "terminated vm X" to "sent request to terminate vm X". vmctl/vmd have not forcibly terminated VMs in a while, we try to let vmmci(4) gracefully shutdown the VM, so "vmctl stop" commands are really requests to stop, not forced stops. The new message indicates that a shutdown is (possibly) in progress and not "complete".
31749646 2017-08-31 06:23:37 vmd/vmctl: disallow use of block or character devices as disks in VMs. These don't work today and present the user with a confusing error message if an attempt is made to use them. This commit detects attempts to use block or character devices and if detected, presents the user with a better message. ok jasper From Carlos Cardenas, thanks!
0ea90cb8 2017-08-30 05:36:23 remove use of PAGE_SIZE and #include <sys/param.h> ok deraadt
2c999465 2017-08-29 21:10:20 quarterly rescan of the tree: remove unneccessary sys/param.h, and annotate the ones which are needed.
4ca02d76 2017-08-18 07:01:29 distinguish errors during vm launch and return different error codes to vmctl so that it can display proper errors for "disk missing" and "bios missing" situations. Expands on an earlier idea/diff from jasper. ok jasper@, pd@, tedu@
4100d478 2017-08-15 15:51:54 merge parse_vmid() and parse_vmname() ok mlarkin@ pd@
9915f44f 2017-08-14 21:41:49 return a proper error message instead of 'no such file or directory' when invoking 'stop' for a non-existent vm ok mlarkin@
6fd9d8e9 2017-08-14 19:46:44 whitespace and fix a comment typo
ad4191f5 2017-08-14 19:38:04 catch ENOENT and display a proper error message when a specified disk image is not found ok mlarkin@
e9affaf6 2017-08-14 17:52:05 don't allow starting vms whose name starts with '-', '.' or '_'
8fde259d 2017-08-10 19:17:43 don't have cu try to open '/dev', instead check if there's a valid tty associated with the vm upfront as discussed with and ok mlarkin@ pd@
69fe6239 2017-07-15 07:33:56 consistent case;
eed20f3b 2017-07-15 05:05:36 Add vmctl send and vmctl receive ok reyk@ and mlarkin@
52e954a3 2017-07-09 00:51:40 vmd/vmctl: Add ability to pause / unpause vms With help from Ashwin Agrawal ok reyk@ mlarkin@
eb33a3b7 2017-06-07 23:15:49 vmctl: change default "vmctl console" (cu) baud rate to 115200. Not strictly needed but matches the previous baudrate diff committed earlier to vmd. ok deraadt, phessler
d1866b5c 2017-05-04 19:41:58 Report command failure back to vmctl reload, reset, load, log verbose. OK mlarkin@
b55cbc1d 2017-05-04 16:54:41 Report error for vmctl commands that need root privileges. specifically: vmctl (load|reload|reset|log) Reported by Christian Barthel
470adcf5 2017-04-19 15:38:32 Add support for dynamic "NAT" interfaces (-L/local interface). 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@
e8c44a33 2017-04-14 00:53:28 Update a man page example to reflect recent changes. Spotted by Ilya Kaliman, thanks.
eb1cd41d 2017-04-06 18:07:13 Do not expose vmm(4) VM IDs to the user, use vmd(8)'s IDs instead. Each VM has two IDs: one from the kernel (vmm) and a different one from userland (vmd). The vmm ID is not consistent and incremented on every boot during runtimg of the host system. The vmd ID remains the same during the lifetime of a configured VM, even after reboots. Configured VMs will even get and keep their IDs when the configuration is loaded. This is more what users expect. Pointed out and tested by otto@ OK deraadt@
d4a2df92 2017-03-30 03:39:35 Set interface flag to VMIFF_UP when using -i option. This way vmd will make sure the interfaces are up on startup. OK deraadt@, reky@
38d0e0c3 2017-03-25 16:28:25 Boot using BIOS from /etc/firmware/vmm-bios by default. Instead of using the internal "vmboot", VMs will now be booted using the external BIOS firmware in /etc/firmware/vmm-bios (which is subject to a LGPLv3 license). Direct booting of OpenBSD kernels or non-default BIOS images is still supported for now using the -b/boot option that is replacing the -k/kernel option. As requested by Theo, vmd(8) fails if neither the default BIOS is found nor a kernel has been specified in the VM configuration. The "vmm" BIOS has to be installed using fw_update(1), which will be done automatically in most cases where the OpenBSD can fetch it after install/upgrade. OK mlarkin@
ed2fe504 2017-03-15 18:00:11 Print "-" if the tty name is empty.
af56b46d 2017-03-03 09:12:40 Undefined behavior: Variable 'user' was used as parameter and destination in snprintf(). Use a temporary variable instead. Found and OK by jsg@