Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/snapshot.h
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | struct restore_state { | ||||
ucl_object_t *meta_root_obj; | ucl_object_t *meta_root_obj; | ||||
}; | }; | ||||
struct checkpoint_thread_info { | struct checkpoint_thread_info { | ||||
struct vmctx *ctx; | struct vmctx *ctx; | ||||
int socket_fd; | int socket_fd; | ||||
}; | }; | ||||
typedef int (*vm_snapshot_dev_cb)(struct vm_snapshot_meta *); | typedef int (*snapshot_dev_cb)(struct vm_snapshot_meta *meta, void *cbdata); | ||||
typedef int (*vm_pause_dev_cb) (struct vmctx *, const char *); | typedef int (*pause_dev_cb)(struct vmctx *ctx, void *cbdata); | ||||
typedef int (*vm_resume_dev_cb) (struct vmctx *, const char *); | typedef int (*resume_dev_cb)(struct vmctx *ctx, void *cbdata); | ||||
struct vm_snapshot_dev_info { | struct snapshot_ops { | ||||
const char *dev_name; /* device name */ | snapshot_dev_cb snapshot_cb; /* callback for device save/restore */ | ||||
vm_snapshot_dev_cb snapshot_cb; /* callback for device snapshot */ | pause_dev_cb pause_cb; /* callback for device pause (optional) */ | ||||
vm_pause_dev_cb pause_cb; /* callback for device pause */ | resume_dev_cb resume_cb; /* callback for device resume (optional) */ | ||||
vm_resume_dev_cb resume_cb; /* callback for device resume */ | |||||
}; | }; | ||||
struct vm_snapshot_kern_info { | struct vm_snapshot_kern_info { | ||||
const char *struct_name; /* kernel structure name*/ | const char *struct_name; /* kernel structure name*/ | ||||
enum snapshot_req req; /* request type */ | enum snapshot_req req; /* request type */ | ||||
}; | }; | ||||
void register_snapshot_dev(const char *devname, struct snapshot_ops *ops, | |||||
void *cbdata); | |||||
void destroy_restore_state(struct restore_state *rstate); | void destroy_restore_state(struct restore_state *rstate); | ||||
const char *lookup_vmname(struct restore_state *rstate); | const char *lookup_vmname(struct restore_state *rstate); | ||||
int lookup_memflags(struct restore_state *rstate); | int lookup_memflags(struct restore_state *rstate); | ||||
size_t lookup_memsize(struct restore_state *rstate); | size_t lookup_memsize(struct restore_state *rstate); | ||||
int lookup_guest_ncpus(struct restore_state *rstate); | int lookup_guest_ncpus(struct restore_state *rstate); | ||||
void checkpoint_cpu_add(int vcpu); | void checkpoint_cpu_add(int vcpu); | ||||
void checkpoint_cpu_resume(int vcpu); | void checkpoint_cpu_resume(int vcpu); | ||||
void checkpoint_cpu_suspend(int vcpu); | void checkpoint_cpu_suspend(int vcpu); | ||||
int restore_vm_mem(struct vmctx *ctx, struct restore_state *rstate); | int restore_vm_mem(struct vmctx *ctx, struct restore_state *rstate); | ||||
int vm_restore_kern_structs(struct vmctx *ctx, struct restore_state *rstate); | int vm_restore_kern_structs(struct vmctx *ctx, struct restore_state *rstate); | ||||
int vm_restore_user_devs(struct vmctx *ctx, struct restore_state *rstate); | int vm_restore_devices(struct vmctx *ctx, struct restore_state *rstate); | ||||
int vm_pause_user_devs(struct vmctx *ctx); | int vm_pause_devices(struct vmctx *ctx); | ||||
int vm_resume_user_devs(struct vmctx *ctx); | int vm_resume_devices(struct vmctx *ctx); | ||||
int get_checkpoint_msg(int conn_fd, struct vmctx *ctx); | int get_checkpoint_msg(int conn_fd, struct vmctx *ctx); | ||||
void *checkpoint_thread(void *param); | void *checkpoint_thread(void *param); | ||||
int init_checkpoint_thread(struct vmctx *ctx); | int init_checkpoint_thread(struct vmctx *ctx); | ||||
void init_snapshot(void); | void init_snapshot(void); | ||||
int load_restore_file(const char *filename, struct restore_state *rstate); | int load_restore_file(const char *filename, struct restore_state *rstate); | ||||
#endif | #endif |