Changeset View
Changeset View
Standalone View
Standalone View
lib/libvmmapi/vmmapi.h
Show All 37 Lines | |||||
#include <stdbool.h> | #include <stdbool.h> | ||||
/* | /* | ||||
* API version for out-of-tree consumers like grub-bhyve for making compile | * API version for out-of-tree consumers like grub-bhyve for making compile | ||||
* time decisions. | * time decisions. | ||||
*/ | */ | ||||
#define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ | #define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ | ||||
/* | |||||
* Note, a bhyve uses its VM name in the path of its unix domain socket. | |||||
* The socket path must be less than SUNPATHLEN (104). | |||||
* The default prefix for BHYVE_RUN_DIR is '/var/run/bhyve/' (15). | |||||
* So, 104-15 = 89. This allows for a VM name of 88 characters (+1 for terminator). | |||||
*/ | |||||
#define MAX_VMNAME 89 | |||||
struct iovec; | struct iovec; | ||||
struct vmctx; | struct vmctx; | ||||
struct vm_snapshot_meta; | struct vm_snapshot_meta; | ||||
enum x2apic_state; | enum x2apic_state; | ||||
/* | /* | ||||
* Different styles of mapping the memory assigned to a VM into the address | * Different styles of mapping the memory assigned to a VM into the address | ||||
* space of the controlling process. | * space of the controlling process. | ||||
▲ Show 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | |||||
int vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, | int vm_setup_freebsd_registers_i386(struct vmctx *vmctx, int vcpu, | ||||
uint32_t eip, uint32_t gdtbase, | uint32_t eip, uint32_t gdtbase, | ||||
uint32_t esp); | uint32_t esp); | ||||
void vm_setup_freebsd_gdt(uint64_t *gdtr); | void vm_setup_freebsd_gdt(uint64_t *gdtr); | ||||
/* | /* | ||||
* Save and restore | * Save and restore | ||||
*/ | */ | ||||
#define MAX_SNAPSHOT_VMNAME 100 | |||||
enum checkpoint_opcodes { | |||||
START_CHECKPOINT = 0, | |||||
START_SUSPEND = 1, | |||||
}; | |||||
struct checkpoint_op { | |||||
unsigned int op; | |||||
char snapshot_filename[MAX_SNAPSHOT_VMNAME]; | |||||
}; | |||||
int vm_snapshot_req(struct vm_snapshot_meta *meta); | int vm_snapshot_req(struct vm_snapshot_meta *meta); | ||||
int vm_restore_time(struct vmctx *ctx); | int vm_restore_time(struct vmctx *ctx); | ||||
#endif /* _VMMAPI_H_ */ | #endif /* _VMMAPI_H_ */ |