Page MenuHomeFreeBSD

bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME
ClosedPublic

Authored by rew on Feb 23 2021, 1:50 AM.
Tags
None
Referenced Files
F156697751: D28879.id84812.diff
Fri, May 15, 6:24 PM
F156690240: D28879.id84513.diff
Fri, May 15, 5:22 PM
F156688217: D28879.diff
Fri, May 15, 5:08 PM
Unknown Object (File)
Thu, May 14, 8:37 PM
Unknown Object (File)
Thu, May 14, 8:37 PM
Unknown Object (File)
Fri, May 8, 6:12 AM
Unknown Object (File)
Fri, May 8, 2:48 AM
Unknown Object (File)
Tue, May 5, 1:41 PM

Details

Summary

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. I suggest
renaming this macro to MAX_SNAPSHOT_FILENAME instead.

Since MAX_SNAPSHOT_FILENAME is used to store a filename, NAME_MAX is
probably a better value. I thought about PATH_MAX, as it may be more
appropriate, but I chose the more conservative value of the two, so
NAME_MAX.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rew requested review of this revision.Feb 23 2021, 1:50 AM
jhb added a subscriber: jhb.

I would probably use PATH_MAX. Another option is that once this socket is a datagram socket, this could become a variable length packet with a VLA for the filename instead of a fixed size buffer.

This revision is now accepted and ready to land.Feb 25 2021, 7:25 PM