Age | Commit message (Collapse) | Author |
|
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@
|
|
going to be used. Issue caused by yesterday's commit, affected certain
guests' consoles after interrupts had been enabled.
spotted by bluhm@, thanks.
|
|
implicit ok from pd@ since he came up with the same diff
|
|
Low baud rates would result in a 0 "rate limiter pause count" in the
serial port output code. This pause counter is used to implement a
delay in what otherwise is an instantaneous serial port output path, and
is needed by some guest OS kernels. This fix only enables the rate
limiter pause if the count is > 0 ("pause after 0 characters" makes no
sense anyway).
Note that this will result in skipping the limiter on unusually low
baud rates, but since nobody is using a low baud rate console in vmd,
I don't think this is going to be a problem.
ok pd
|
|
qc2_open() calls qc2_close() on error which already frees diskp.
OK ccardenas@
|
|
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)
|
|
ok mlarkin@ jmc@ jca@
|
|
Fix a bug where a vm was removed in vmd.c after vmctl send even if sending
failed.
spotted by solene@
ok mlarkin@
|
|
OK mlarkin@
|
|
Please avoid tabs and excessive multi-line information with log_debug
as it also goes to syslog.
No functional change.
|
|
Reported by Greg Steuck
OK mlarkin@
|
|
- qcow2: general cleanup
- vioraw: check malloc
- virtio: add function to sync disks
- vm: call virtio_shutdown to sync disks when vm is finished executing
Thanks to Ori Bernstein.
Ok miko@
|
|
This unbreaks vmctl receive.
ok ccardenas@
|
|
Change "fmt" to "format".
Ok kn@
|
|
While here, minor cleanup on logging.
|
|
properly initialized with -1. Also avoid closing -1.
OK mlarkin@
|
|
proc_init(). As a consequence vmd(8) child processes did not detach
from the terminal anymore. Dup /dev/null to the stdio file descriptors
in the children.
OK mlarkin@ reyk@
|
|
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.
|
|
"looks good" gilles@ halex@
|
|
This is prep work for adding qcow2 image support.
From Ori Bernstein. Many thanks!
Tested by many.
OK ccardenas@
|