Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/snapshot.c
Show First 20 Lines • Show All 1,487 Lines • ▼ Show 20 Lines | for (;;) { | ||||||||
else | else | ||||||||
EPRINTLN("Failed to receive message: %s\n", | EPRINTLN("Failed to receive message: %s\n", | ||||||||
n == -1 ? strerror(errno) : "unknown error"); | n == -1 ? strerror(errno) : "unknown error"); | ||||||||
} | } | ||||||||
return (NULL); | return (NULL); | ||||||||
} | } | ||||||||
void | |||||||||
init_snapshot(void) | |||||||||
{ | |||||||||
int err; | |||||||||
err = pthread_mutex_init(&vcpu_lock, NULL); | |||||||||
if (err != 0) | |||||||||
errc(1, err, "checkpoint mutex init"); | |||||||||
err = pthread_cond_init(&vcpus_idle, NULL); | |||||||||
if (err != 0) | |||||||||
errc(1, err, "checkpoint cv init (vcpus_idle)"); | |||||||||
markjUnsubmitted Done Inline Actions
markj: | |||||||||
err = pthread_cond_init(&vcpus_can_run, NULL); | |||||||||
if (err != 0) | |||||||||
errc(1, err, "checkpoint cv init (vcpus_can_run)"); | |||||||||
} | |||||||||
Done Inline ActionsExtra newline. markj: Extra newline. | |||||||||
/* | /* | ||||||||
* Create the listening socket for IPC with bhyvectl | * Create the listening socket for IPC with bhyvectl | ||||||||
*/ | */ | ||||||||
int | int | ||||||||
init_checkpoint_thread(struct vmctx *ctx) | init_checkpoint_thread(struct vmctx *ctx) | ||||||||
{ | { | ||||||||
struct checkpoint_thread_info *checkpoint_info = NULL; | struct checkpoint_thread_info *checkpoint_info = NULL; | ||||||||
struct sockaddr_un addr; | struct sockaddr_un addr; | ||||||||
int socket_fd; | int socket_fd; | ||||||||
pthread_t checkpoint_pthread; | pthread_t checkpoint_pthread; | ||||||||
char vmname_buf[MAX_VMNAME]; | char vmname_buf[MAX_VMNAME]; | ||||||||
int ret, err = 0; | int ret, err = 0; | ||||||||
memset(&addr, 0, sizeof(addr)); | memset(&addr, 0, sizeof(addr)); | ||||||||
err = pthread_mutex_init(&vcpu_lock, NULL); | |||||||||
if (err != 0) | |||||||||
errc(1, err, "checkpoint mutex init"); | |||||||||
err = pthread_cond_init(&vcpus_idle, NULL); | |||||||||
if (err == 0) | |||||||||
err = pthread_cond_init(&vcpus_can_run, NULL); | |||||||||
if (err != 0) | |||||||||
errc(1, err, "checkpoint cv init"); | |||||||||
socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0); | socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0); | ||||||||
if (socket_fd < 0) { | if (socket_fd < 0) { | ||||||||
EPRINTLN("Socket creation failed: %s", strerror(errno)); | EPRINTLN("Socket creation failed: %s", strerror(errno)); | ||||||||
err = -1; | err = -1; | ||||||||
goto fail; | goto fail; | ||||||||
} | } | ||||||||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |