From owner-dev-commits-src-all@freebsd.org Sat Feb 27 21:45:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E743554F8B; Sat, 27 Feb 2021 21:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp0Sp2d2lz3wY4; Sat, 27 Feb 2021 21:45:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9FDE24CB9; Sat, 27 Feb 2021 21:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11RLjjSM047386; Sat, 27 Feb 2021 21:45:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11RLjjdF047385; Sat, 27 Feb 2021 21:45:45 GMT (envelope-from git) Date: Sat, 27 Feb 2021 21:45:45 GMT Message-Id: <202102272145.11RLjjdF047385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: d656ce199d72 - main - bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d656ce199d72f1aeeef1b2e28b4a284c968a8d03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2021 21:45:47 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=d656ce199d72f1aeeef1b2e28b4a284c968a8d03 commit d656ce199d72f1aeeef1b2e28b4a284c968a8d03 Author: Robert Wing AuthorDate: 2021-02-27 21:07:35 +0000 Commit: Robert Wing CommitDate: 2021-02-27 21:07:35 +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 --- 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 #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)); }