Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyvectl/bhyvectl.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#define MB (1UL << 20) | #define MB (1UL << 20) | ||||
#define GB (1UL << 30) | #define GB (1UL << 30) | ||||
#define REQ_ARG required_argument | #define REQ_ARG required_argument | ||||
#define NO_ARG no_argument | #define NO_ARG no_argument | ||||
#define OPT_ARG optional_argument | #define OPT_ARG optional_argument | ||||
#define CHECKPOINT_RUN_DIR "/var/run/bhyve/checkpoint" | #define BHYVE_RUN_DIR "/var/run/bhyve" | ||||
#define MAX_VMNAME 100 | #define MAX_VMNAME 100 | ||||
static const char *progname; | static const char *progname; | ||||
static void | static void | ||||
usage(bool cpu_intel) | usage(bool cpu_intel) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,617 Lines • ▼ Show 20 Lines | send_checkpoint_op_req(struct vmctx *ctx, struct checkpoint_op *op) | ||||
addr.sun_family = AF_UNIX; | addr.sun_family = AF_UNIX; | ||||
err = vm_get_name(ctx, vmname_buf, MAX_VMNAME - 1); | err = vm_get_name(ctx, vmname_buf, MAX_VMNAME - 1); | ||||
if (err != 0) { | if (err != 0) { | ||||
perror("Failed to get VM name"); | perror("Failed to get VM name"); | ||||
goto done; | goto done; | ||||
} | } | ||||
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s", CHECKPOINT_RUN_DIR, vmname_buf); | snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s", BHYVE_RUN_DIR, vmname_buf); | ||||
if (connect(socket_fd, (struct sockaddr *)&addr, | if (connect(socket_fd, (struct sockaddr *)&addr, | ||||
sizeof(struct sockaddr_un)) != 0) { | sizeof(struct sockaddr_un)) != 0) { | ||||
perror("Connect to VM socket failed"); | perror("Connect to VM socket failed"); | ||||
err = -1; | err = -1; | ||||
goto done; | goto done; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 709 Lines • Show Last 20 Lines |