Age | Commit message (Collapse) | Author |
|
ok mlarkin@
|
|
Found by Hiltjo Posthuma, thanks!
|
|
start. Favoring 'invalid template' over 'permission denied' should give
the user a better hint on what went wrong.
ok kn@ mlarkin@
|
|
Implement VMM_IOC_READVMPARAMS and VMM_IOC_WRITEVMPARAMS ioctls to read and
write pvclock state.
reads ok mlarkin@
|
|
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
|
|
Remove the scratch register (8250s don't have this), and reorganize
some constants to be able to more easily support more than one serial
port in the future.
ok deraadt
Diff from Katherine Rohl, thanks!
|
|
These never got unset on AMD/SVM guests when booted via vmctl start
-b causing them to run very slow
ok mlarkin@
|
|
if something changed in register A.
when updating register A we were checking in register B if the
PIE bit was set in order to decide if rtc_reschedule_per needed
to be called. if that bit was changed then the timer rate would
already have been adjusted by rtc_update_regb so the call from
rtc_update_rega is not needed.
this now matches what qemu and other emulators are doing too.
ok mlarkin@
|
|
to crash vmd and take all other vms with it. this required a little
shuffling to get the error value reported back to the caller to
handle the error properly.
ok mlarkin@
|
|
Define a local definition of LOADADDR() instead of pulling in
machine/loadfile_machdep.h. vmd -b requires the addresses to be masked
and the new bootloader no longer does that.
OK pd@ kettenis@
|
|
Part of a patch from Stephen Gregoratto <dev at sgregoratto dot me>.
|
|
counterpart from vmctl.
ok mlarkin@
|
|
Add a first cut of x86 page table walker to vmd(8) and vmm(4). This function is
not used right now but is a building block for future features like HPET, OUTSB
and INSB emulation, nested virtualisation support, etc.
With help from Mike Larkin
ok mlarkin@
|
|
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@
|
|
set it to VMM_HV_SIGNATURE and check for it upon restoring a vm image
ok mlarkin@ pd@
|
|
|
|
instead of
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@
|
|
knows the vm is paused, but vmd does not.
ok mlarkin@ pd@
|
|
ok pd@
|
|
vm console. Instead, wait for the controlling end of the pty to become
writeable, which implies that the slave end is connected. A recent
change to the kqueue pty implementation caused vmd to hammer the log due
to constantly hitting EOF while reading from the pty since the slave end
was disconnected.
Issue found the hard way by mlarkin@ and tb@
ok mlarkin@
|
|
`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
|
|
ok pd, kn, deraadt
|
|
Initializes the %drX registers to power on defaults, and bump the VM
send/recieve header to reflect same
discussed with deraadt@
|
|
larger types really is a range reduction...
Almost any cast to (unsigned) is a bug.
ok millert tb benno
|
|
On some recent Linux guests, the virtio network interface is named based
on its PCI slot assignment, eg "enp0s3".
Prior to this change, vmd assigned disks first, meaning if you used a disk
image to install Linux and then removed it after install, the network
interface name would change from "enp0s3" to "enp0s2" (for example). This
broke any autoconfiguration script config files written during the install
and generally led to users just being confused about what was going on.
This change reorders the vmd PCI device assignment to put network
interfaces before disks, as disk devices don't seem to have the same
naming issue. This means the slot for network interfaces won't change.
IMPORTANT NOTE - if you have existing Linux guest VMs, you'll need to
manually fixup your config files (once).
ok ajacoutot, phessler, ccardenas, deraadt@
|
|
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@
|
|
it is entirely unavoidable (for example libc/*/exec.c), because any erroneous
size controlled by an attacker turns into a known-location object placement
in a very dangerous region. So use malloc() instead.
|
|
include new virtio_pcireg.h header
|
|
option in the lease to the name of the vm. Makes it easier to use
dedicated autoinstall response files for different vms.
ok ccardenas@
|
|
all memory at once without having to use a zero buffer.
OK mlarkin@
|
|
OK mlarkin@
|
|
if a bootdevice was forced. This implements both the pure IO port interface
and also the new DMA interface, a few direct commands are implemented which
are needed but in general the "file" interface should be used. There is no
write support for the guest. Tested against the latest vmm-firmware port.
This requires also a -current kernel to pass the IO ports to vmd(8).
OK mlarkin@ ccardenas@
|
|
OK mlarkin@ ccardenas@
|
|
behaviour of vmd to stop / exit at guest reboot.
OK ccardenas@
|
|
currently only when booting a OpenBSD kernel. If VMBOOTDEV_NET is used the
internal dhcp server will pass "auto_install" as boot file to the client and
the boot loader passes the MAC of the first interface to the kernel to indicate
PXE booting. Adding boot order support to SeaBIOS is not yet implemented.
Ok ccardenas@
|
|
vmctl peerid that should be informed when the VM is stopped (like when the
guest does a shutdown). Uses the same logic as using the VMOP_WAIT flag on
IMSG_VMDOP_TERMINATE_VM_REQUEST.
Ok ccardenas@, reyk@
|
|
This way they are in the appropriate place and code can be shared with vmd.
Ok ori@ mlarkin@ ccardenas@
|
|
This means that when using '-L', the IP addresses of the VMs are stable.
ok reyk@
|
|
This turns most warn + returns that should never happen into hard failures,
and improves the user directed error messages.
ok @mlarkin, @reyk
|
|
|
|
ok & test ccardenas@, additional review from kn@
|
|
(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 disk path wasn't updated so vmd tried to open the derived disk
image for each base over and over again.
OK ori@ mlarkin@
|
|
We used to truncate the disk end by anding it with a 32 bit value.
The 32 bit value was not sign extended, which causes the disk size
to wrap at 4 gigabytes:
disk->end = (disk->end + disk->clustersz - 1) & ~(disk->clustersz - 1);
This change converts the clustersz to an off_t in order to remove the
class of errors by avoiding type conversions entirely.
|
|
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@
|
|
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@
|
|
This fixes code that detects if boot and the first disk are identical.
OK mlarkin@
|
|
This looping has been experienced by people who run VMs with a broken
kernel or boot loader that trigger a very fast reboot loop (triple
fault) of a VM that ends up using a lot of CPU and resources on the
host. Some fixes in vmm(4) and vmd(8) helped to avoid such conditions
but it can still occur if something is wrong in the guest VM itself.
If the VM restarts after less than VM_START_RATE_SEC (6) seconds, we
increment the limit counter. After VM_START_RATE_LIMIT (3) of suchs
fast reboots the VM is stopped.
There are only very few people who intentionally want to reboot-loop a
VM very quickly (many times within a second); mostly for fuzzing.
They will have to recompile and adjust the stated #defines in the code
as we don't have a config option to disable it.
OK mlarkin@
|
|
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@
|