Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libvmmapi/vmmapi.c
Show All 28 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/ioctl.h> | #include <sys/ioctl.h> | ||||
#include <sys/linker.h> | |||||
#include <sys/mman.h> | #include <sys/mman.h> | ||||
#include <sys/module.h> | |||||
#include <sys/_iovec.h> | #include <sys/_iovec.h> | ||||
#include <sys/cpuset.h> | #include <sys/cpuset.h> | ||||
#include <x86/segments.h> | #include <x86/segments.h> | ||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | vm_device_open(const char *name) | ||||
free(vmfile); | free(vmfile); | ||||
return (fd); | return (fd); | ||||
} | } | ||||
int | int | ||||
vm_create(const char *name) | vm_create(const char *name) | ||||
{ | { | ||||
/* Try to load vmm(4) module before creating a guest. */ | |||||
if (modfind("vmm") < 0) { | |||||
if (modfind("vmm") < 0) | |||||
kldload("vmm"); | |||||
} | |||||
return (CREATE((char *)name)); | return (CREATE((char *)name)); | ||||
} | } | ||||
struct vmctx * | struct vmctx * | ||||
vm_open(const char *name) | vm_open(const char *name) | ||||
{ | { | ||||
struct vmctx *vm; | struct vmctx *vm; | ||||
▲ Show 20 Lines • Show All 1,467 Lines • Show Last 20 Lines |