aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Wing <rew@FreeBSD.org>2021-02-27 21:07:35 +0000
committerRobert Wing <rew@FreeBSD.org>2021-02-27 21:07:35 +0000
commitd656ce199d72f1aeeef1b2e28b4a284c968a8d03 (patch)
tree0ca0f98b758c937713b32445f40e125c677e28c7
parentda9713917eb26b67bafc740384ccd44f7dff09f2 (diff)
downloadsrc-d656ce199d72f1aeeef1b2e28b4a284c968a8d03.tar.gz
src-d656ce199d72f1aeeef1b2e28b4a284c968a8d03.zip
bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME
MAX_SNAPSHOT_VMNAME is a macro used to set the size of a character buffer that stores a filename or the path to a file - this file is used by the save/restore feature. Since the file doesn't have anything to do with a vm name, rename MAX_SNAPSHOT_VMNAME to MAX_SNAPSHOT_FILENAME. Bump the size to PATH_MAX while here. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28879
-rw-r--r--usr.sbin/bhyve/snapshot.h4
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bhyve/snapshot.h b/usr.sbin/bhyve/snapshot.h
index 62b2083b9830..8a6ee67ef19d 100644
--- a/usr.sbin/bhyve/snapshot.h
+++ b/usr.sbin/bhyve/snapshot.h
@@ -43,7 +43,7 @@
#include <ucl.h>
#define BHYVE_RUN_DIR "/var/run/bhyve/"
-#define MAX_SNAPSHOT_VMNAME 100
+#define MAX_SNAPSHOT_FILENAME PATH_MAX
struct vmctx;
@@ -67,7 +67,7 @@ enum ipc_opcode {
struct checkpoint_op {
unsigned int op;
- char snapshot_filename[MAX_SNAPSHOT_VMNAME];
+ char snapshot_filename[MAX_SNAPSHOT_FILENAME];
};
struct checkpoint_thread_info {
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index f9a790f5402e..68cc958e66ec 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -1739,7 +1739,7 @@ snapshot_request(struct vmctx *ctx, const char *file, enum ipc_opcode code)
struct checkpoint_op op;
op.op = code;
- strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_VMNAME);
+ strlcpy(op.snapshot_filename, file, MAX_SNAPSHOT_FILENAME);
return (send_checkpoint_op_req(ctx, &op));
}