Index: usr.sbin/bhyve/bhyverun.c =================================================================== --- usr.sbin/bhyve/bhyverun.c +++ usr.sbin/bhyve/bhyverun.c @@ -1021,9 +1021,6 @@ setproctitle("%s", vmname); #ifdef BHYVE_SNAPSHOT - /* initialize mutex/cond variables */ - init_snapshot(); - /* * checkpointing thread for communication with bhyvectl */ Index: usr.sbin/bhyve/snapshot.h =================================================================== --- usr.sbin/bhyve/snapshot.h +++ usr.sbin/bhyve/snapshot.h @@ -100,7 +100,6 @@ int get_checkpoint_msg(int conn_fd, struct vmctx *ctx); void *checkpoint_thread(void *param); int init_checkpoint_thread(struct vmctx *ctx); -void init_snapshot(void); int load_restore_file(const char *filename, struct restore_state *rstate); Index: usr.sbin/bhyve/snapshot.c =================================================================== --- usr.sbin/bhyve/snapshot.c +++ usr.sbin/bhyve/snapshot.c @@ -137,8 +137,9 @@ }; static cpuset_t vcpus_active, vcpus_suspended; -static pthread_mutex_t vcpu_lock; -static pthread_cond_t vcpus_idle, vcpus_can_run; +static pthread_mutex_t vcpu_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t vcpus_idle = PTHREAD_COND_INITIALIZER; +static pthread_cond_t vcpus_can_run = PTHREAD_COND_INITIALIZER; static bool checkpoint_active; /* @@ -1395,22 +1396,6 @@ } IPC_COMMAND(ipc_cmd_set, checkpoint, vm_do_checkpoint); -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)"); - err = pthread_cond_init(&vcpus_can_run, NULL); - if (err != 0) - errc(1, err, "checkpoint cv init (vcpus_can_run)"); -} - /* * Create the listening socket for IPC with bhyvectl */