git: bcf297e86e16 - stable/13 - bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Jan 2023 18:54:19 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=bcf297e86e16232b2ebb9a7a09d776c09bc3435d
commit bcf297e86e16232b2ebb9a7a09d776c09bc3435d
Author: Robert Wing <rew@FreeBSD.org>
AuthorDate: 2021-02-27 21:07:35 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-01-26 18:45:54 +0000
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
(cherry picked from commit d656ce199d72f1aeeef1b2e28b4a284c968a8d03)
---
usr.sbin/bhyve/snapshot.h | 4 ++--
usr.sbin/bhyvectl/bhyvectl.c | 2 +-
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 5683a84c0242..0f7b9533fe4b 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));
}