summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Don't attempt to call vm_remove() with a NULL vm: some functions likereyk2016-11-221-6/+7
| | | | | | config_getvm() already removed the vm on failure! Found by mlarkin@
* Fix error path of config_setvm() and its callers. This unbreaksreyk2016-11-222-52/+31
| | | | | | | loading of invalid kernel files. Reported by mlarkin@ OK mlarkin@
* Restore previous errno after log_warn*() to make sure that it neverreyk2016-11-221-1/+3
| | | | | | alters it. OK mlarkin@
* There is no need for res when there is already ret.reyk2016-11-221-5/+4
|
* Insert disabled VMs into vmd(8)'s queues and allow vmctl(8) to display them.edd2016-11-223-9/+50
| | | | | | | | Tested by Jon Bernard and reyk@. OK reyk@, no objections mlarkin@. Thanks
* Remove some old code that isn't needed anymore.mlarkin2016-11-201-11/+2
|
* Sync switchd(8) and vmd(8) with the latest proc.c changes. This syncrzalamena2016-11-162-7/+27
| | | | | | basically imports the imsg_flush() fix from reyk@ in httpd(8). ok reyk@
* Pass the internal vmid or 0 to vm_register() instead of changing itreyk2016-11-044-11/+13
| | | | | | 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-045-202/+215
| | | | | | style that is used in other places. Also keep the vmid from the parent. OK edd@
* Pass the errno value to vfatal(), renaming it to vfatalc() to match,guenther2016-10-311-8/+6
| | | | | | intead of using errno as an implicit argument ok reyk@
* 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-296-66/+145
| | | | | | | 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.
* vmd(8)/vmctl(8) for i386. Some ugliness in #ifdef __i386__ areas will bemlarkin2016-10-266-10/+54
| | | | | | | | fixed in tree, but the changes required were pretty minimal. Note that i386 hosts are still presently limited to running i386 guests. ok deraadt, stefan, jca
* some readability fixes for the SWITCH CONFIGURATION section,jmc2016-10-201-14/+27
| | | | | | from edd barrett; while here, there seems to be three sections to the config file, not two;
* When the guest OS gets a zero MAC address on a network interface, it shouldreyk2016-10-182-12/+25
| | | | | | | | | | create a randomized locally administrated address. OpenBSD as a guest OS does this correctly but we cannot rely on it for other guests, so randomize the MAC address in vmd(8) on the host side if it is not specified by the user. I incremented the prefix by one to differentiate from the ones that are generated by OpenBSD in the kernel; fe:e1:bb:xx:xx:xx. OK deraadt@ mlarkin@
* Add the option to specify an interface group per virtual switch as well;reyk2016-10-175-18/+52
| | | | | | this group will be added to all VM tap(4) interfaces in the switch. Tested by martijn@
* Prefer memcpy/memmove over bcopyguenther2016-10-161-2/+2
| | | | ok mlarkin@
* Allow to add an interface to an interface group; with the group keyword.reyk2016-10-156-9/+89
| | | | Requested and tested by martijn@
* Fix functionality and semantics of vmctl load/reload/reset.reyk2016-10-124-21/+42
| | | | OK rzalamena@
* For correctness, always save errno when doing additional actionsreyk2016-10-121-8/+11
| | | | | | before printing it. OK rzalamena@
* The error case checks for saved_errno, set it accordinglyreyk2016-10-121-2/+2
|
* Allow 4 vio(4) interfaces in each VM. Also fix a bad interrupt assignment thatmlarkin2016-10-125-24/+43
| | | | | | | caused IRQ9 to be shared between the second disk device and the vio(4)s, which caused poor network performance. ok reyk, stefan
* Sync proc.c file vmd(8) and switchd(8).rzalamena2016-10-111-78/+90
| | | | | | | | | New changes: * Fix msgbuf_write() usage idiom; * Add context (function name) that fatal()ed; * Use less fds on startup; ok mlarkin@, reyk@
* Enable pledge(2) in vmm and the VM processes: This way the VMs andreyk2016-10-061-8/+3
| | | | | | | | | | | their monitor run in a very restricted environment. VMs only pledge "stdio vmm" which allows them to do most basic functions and a subset of vmm ioctls (the other part of vmm ioctls are only permitted in the parent). This requires the previous change in the vmm kernel part. OK mlarkin@
* Terminate VMs on shutdown of vmd instead of leaving them running asreyk2016-10-063-5/+24
| | | | | | undead VM processes. OK mlarkin@
* tweak previous;jmc2016-10-061-6/+5
|
* Sync with httpd(8) proc file. Check for dup2() usage to avoid oldd == newdrzalamena2016-10-051-2/+8
| | | | | | and remove the CLOEXEC with fcntl() if necessary. ok reyk@
* 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-059-93/+685
| | | | | | See vm.conf(5) for more details. OK mlarkin@
* Call setsid() to create a new session for the executed processes.reyk2016-10-051-1/+5
| | | | | From deraadt@ OK rzalamena@
* Add a new "priv" process that is responsible for ioctls and restrictedreyk2016-10-048-34/+282
| | | | | | | | | | | operations that aren't allowed under pledge. This is a companion to the "vmd" process that runs as root but with pledge. With the "priv" process, each new tap(4) interface now gets a description to indicate the vm, eg. "vm1-if0-myvm". For network configuration will be done by vmd/priv later. OK mlarkin@
* add RCS tagsmlarkin2016-10-038-0/+8
|
* style cleanupmlarkin2016-10-031-5/+3
|
* Implement fork+exec for vmd, using the same framework from httpd etc.reyk2016-09-297-279/+416
| | | | No objections from mlarkin@ sunil@
* move the .SUNW_ctf section name definition to exec_elf.h and document it in elf(5)jasper2016-09-171-2/+2
| | | | | feedback from guenther@ ok guenther@ kettenis@
* sync with sys/lib/libsa/loadfile_elf.c -r1.12 and load the .SUNW_ctf sectionjasper2016-09-131-2/+3
| | | | pointed out by mlarkin@
* As vmm(4) can now exit to vmd at any time to process pending interrupts,mlarkin2016-09-031-3/+5
| | | | | | | | | don't kill the VM if we are presented with an exit type that is not something we directly need to handle. Instead, simply re-enter the guest, possibly injecting an interrupt along the way. Still exit the process if presented with a triple fault, until we implement reboot support. ok stefan@
* fix some wrong interrupt code that doesn't fit with the new modelmlarkin2016-09-031-8/+0
| | | | ok stefan@
* Adding a clean up block to vioblk_notifyq() and vionet_enq_rx()nayden2016-09-031-43/+22
| | | | OK mlarkin@
* Make error handling in config_getvm() more robuststefan2016-09-031-15/+62
| | | | | | | | | | | Open all fds first before sending messages to the vmm process. This prevents some intermediate state from being generated that will confuse vmm if it gets further messages. Also make sure that vmctl gets the right error reason later by saving errno upon a failure. ok reyk@ mlarkin@
* Process incoming com data asynchronously to running VCPUstefan2016-09-023-90/+167
| | | | | | | This registers a handler with libevent that is triggered on incoming data on the com port. ok mlarkin@
* Process incoming host->guest packets asynchronously to running VCPUstefan2016-09-022-5/+96
| | | | | | | | This registers a handler with libevent that is called on incoming packets for the guest. If they cannot be handled immediately (because the virtq is full), make sure they are handled on VCPU exits. ok mlarkin@
* Move event handling to separate threadstefan2016-09-022-30/+154
| | | | | | | | | That allows the main thread to handle the termination of a VM on reboot/shutdown or normal exit. The way it works is that VCPUs that terminate for some reason communicate this to a main thread that takes care of shutdown. ok mlarkin@
* normalize some function namesmlarkin2016-09-011-10/+10
|
* fix a merge collision, and add some retval checking on various pthread_*mlarkin2016-09-011-13/+36
| | | | functions
* change some log_warn to log_warnx and convert some integer literals tomlarkin2016-09-015-49/+49
| | | | enumerand values
* Make vcpu_reset_regs use new writeregs codestefan2016-09-013-37/+37
| | | | Makes reset code a little simpler. ok mlarkin@
* forgot during previous commit, thanks stefan@mlarkin2016-09-011-3/+3
|
* Add a set of emulated legacy devices (PIT, PIC, RTC)mlarkin2016-09-0111-567/+1940
| | | | discussed with stefan and deraadt
* Fix 2 minor issues and a typo in a comment in the pci emulation subsystem.mlarkin2016-09-011-5/+22
| | | | | | The first issue caused trash to be returned from an i/o port read where that port was unclaimed by any emulated device. The second issue caused improper BAR sizes to be reported for unassigned device BARs.