Page MenuHomeFreeBSD

D28878.diff
No OneTemporary

D28878.diff

diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -1734,25 +1734,12 @@
}
static int
-send_start_checkpoint(struct vmctx *ctx, const char *checkpoint_file)
+snapshot_request(struct vmctx *ctx, const char *file, enum ipc_opcode code)
{
struct checkpoint_op op;
- op.op = START_CHECKPOINT;
- strncpy(op.snapshot_filename, checkpoint_file, MAX_SNAPSHOT_VMNAME);
- op.snapshot_filename[MAX_SNAPSHOT_VMNAME - 1] = 0;
-
- return (send_checkpoint_op_req(ctx, &op));
-}
-
-static int
-send_start_suspend(struct vmctx *ctx, const char *suspend_file)
-{
- struct checkpoint_op op;
-
- op.op = START_SUSPEND;
- strncpy(op.snapshot_filename, suspend_file, MAX_SNAPSHOT_VMNAME);
- op.snapshot_filename[MAX_SNAPSHOT_VMNAME - 1] = 0;
+ op.op = code;
+ strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_VMNAME);
return (send_checkpoint_op_req(ctx, &op));
}
@@ -2416,10 +2403,10 @@
#ifdef BHYVE_SNAPSHOT
if (!error && vm_checkpoint_opt)
- error = send_start_checkpoint(ctx, checkpoint_file);
+ error = snapshot_request(ctx, checkpoint_file, START_CHECKPOINT);
if (!error && vm_suspend_opt)
- error = send_start_suspend(ctx, suspend_file);
+ error = snapshot_request(ctx, suspend_file, START_SUSPEND);
#endif
free (opts);

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 1:21 PM (5 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16197433
Default Alt Text
D28878.diff (1 KB)

Event Timeline