Age | Commit message (Collapse) | Author |
|
Forgot one change during an earlier commit; use 'int ch' to make builds
complete without warning on arm64.
ok dv
|
|
Makes as much of the core of vmd mi, pushing x86-isms into separate
compilation units. Adds build logic for arm64, but no emulation
yet. (You can build vmd, but it won't have a vmm device to connect
to.)
Some more cleanup probably needed around interrupt controller
abstraction, but that can come as we implement more than the i8259.
ok mlarkin@
|
|
set exit code to 1 if no running VMs are detected with vmctl stat -r.
ok dv
|
|
|
|
|
|
The -r option can be used to limit the output of 'vmctl status' to only
running VMs. This is useful for machines that have a large number of
stopped VMs, as the running ones are printed at the top by default and
previously required scrolling back to see the list of running VMs, and/or
using 'grep RUNNING'.
There is no change for users not using -r.
ok dv
|
|
ctl_convert still had old logic assuming disk sizes were in MiB and
not bytes, causing an attempt to create a new disk using the '-i'
argument to generate impossibly large output disk images (e.g. 1 MiB
ends up 1 TiB).
Reported by and diff from Jesper Wallin.
|
|
|
|
Clarify that vmctl start max memory is governed by the vmd(8) user's
max datasize in /etc/login.conf and that vmctl reload only reloads
state for non-running VMs.
ok dv
|
|
The vmctl `start` command allows the user to pass an optional
"kernel" file (either a ramdisk kernel or a SeaBIOS image). This
file is opened by vmctl and the descriptor passed via imsg.
If the file provided isn't a regular file, the attempt to send the
start message to vmd(8)'s control socket will fail and results in
a the vmctl process aborting.
Check the file type after open and fail gracefully if not a regular
file.
reported by and ok gnezdo@
|
|
ok dv@
|
|
|
|
vmd allows non-root users to "own" a vm defined in vm.conf(5). While
the user can start/stop the vm, if they break their filesystem they
have no means of booting recovery media like a ramdisk kernel.
This change opens the provided boot kernel via vmctl and passes the
file descriptor through the control channel to vmd. The next boot
of the vm will use the provided file descriptor as boot kernel/bios.
Subsequent boots (e.g. a reboot) will return to using behavior
defined in vm.conf or the default bios image.
ok mlarkin@
|
|
Finally! We can remove kernel headers from vmctl.
ok mlarkin@
|
|
The object sent to vmm(4) contained file paths and details the
kernel does not need for cpu virtualization as device emulation is
in userland. Effectively, "pull up" the struct members from the
vm_create_params struct to the parent vmop_create_params struct.
This allows us to clean up some of vmd(8) and simplify things for
switching to having vmctl(8) open the "kernel" file (SeaBIOS, bsd.rd,
etc.) to allow users to boot recovery ramdisk kernels.
ok mlarkin@
|
|
Part of an ongoing effort to move userland-specific information out
of a kernel header and directly into vmd(8). No functional change.
ok mlarkin@
|
|
ok mestre@ martijn@
|
|
Make "vmctl create -s3G 1.img 2.img" fail instead of just creating 1.img
and ignoring 2.img.
OK dv cheloha
|
|
create_imagefile() became MB. Also change the arguement's type from
long to uint64_t that is preferred.
ok dv
|
|
Continue converting other parts to storing data in bytes instead
of MB. In this case, the logic for disk sizes was being scaled.
This fixes issues reported by Martin Vahlensieck where vmctl could
no longer create disks larger than 7 MiB after previous commits to
change storing memory sizes as bytes.
While this keeps the vm memory limit check in vmctl's size parser,
it skips the limit check for disks. The error messages adjust
accordingly and this removes the double error message logging.
Update comments and function types accordingly.
ok marlkin@
|
|
Continuation of commitid RbITgDkOsW8SMssz removing use of megabytes
instead of bytes in vmm(4) and vmctl(8). Missed this spot that only
manifests after a vm is started and has its runtime details
inspected.
|
|
At different points in the vm lifecycle vmm(4), vmctl(8), and vmd(8)
refer to a vm's memory range sizes in either bytes or megabytes.
This is needlessly complex.
Switch to using bytes everywhere and adjust types and constants
accordingly. While this makes it possible to specify vm's with
memory in fractions of megabytes, the logic requiring whole
megabyte values remains.
Feedback from deraadt@, mlarkin@, and Matthew Martin.
ok mlarkin@
|
|
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.
Work done and verified by Ashton Fagg <ashton@fagg.id.au>
ok deraadt@ semarie@ claudio@
|
|
|
|
|
|
Instead of translating imsg types, update vmclt(8) to handle receiving
IMSG_VMDOP_TERMINATE_VM_EVENT messages on vm termination.
This finishes the work previously committed for supporting multiple
waiters or the cancellation of a client waiting on a vm shutdown.
vmd no longer needs to translate an IMSG_VMDOP_TERMINATE_VM_RESPONSE
into an *_EVENT.
ok mlarkin@
|
|
James Cook reported an issue creating images from qcow2 disks that
contained base images. Initial approach suggested was to replace the
use of realpath(3), but since this is common code used in vmd(8) the
better option is to just remove the use of unveil(1) in vmctl. (It was
added very early in vmctl's development before support for disk
conversion was added.)
This does not change existing unveil usage in vmctl for things like the
control socket or the serial console. There's no change to vmd either.
Discussed with and OK from mlarkin@
|
|
Reported by Preben Guldberg. ok mlarkin@
|
|
The previous argument parsing logic had at least three bugs:
a copy-paste error led to an off-by-one and a printf "%s" NULL,
as reported by Preben Guldberg. A previous commit led to a dead
else branch and a use of uninitialized. This can all be avoided
by reworking the logic so as to be readable.
Prompted by a diff from Preben
ok dv
|
|
Diff from Preben Guldberg < preben at guldberg dot org>, thanks!
In "vmctl status", VMs that are being stopped but are still running
will simply show up as "running".
Give preference to showing the "stopping" state akin to how a paused
VM is handled.
Tested by Dave Voutila
OK tb
|
|
Feedback jmc
OK dlg
|
|
|
|
If the path to a tty doesn't contain a '/' or ends in a '/' use the full
path. (The intent is to chop off the leading "/dev/")
ok deraadt (who had the same diff) martijn millert
|
|
from Matt Schultz
|
|
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
|
|
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
|
|
vmctl send always returned exit code 1
Patch by Benjamin Baier
ok kn@
|
|
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
|
|
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
|
|
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
|
|
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@)
|
|
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
|
|
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!
|
|
ok mlarkin@
|
|
Fix a wrong output when using 'vmctl stop' without any further arguments.
Patch from Caspar Schutijser, thanks!
ok deraadt
|
|
start. Favoring 'invalid template' over 'permission denied' should give
the user a better hint on what went wrong.
ok kn@ mlarkin@
|
|
|
|
from alessandro gallo
|
|
|
|
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@
|