HomeFreeBSD

vmm: Consolidate VM name length checking

Description

vmm: Consolidate VM name length checking

vm_create() is only called from one place. Rather than having similar
checks everywhere, move them to vmmdev_create().

We can safely assume that the name is nul-terminated, the vmmctl ioctl
handler and the legacy sysctl handler ensure this. So, don't bother
with strnlen().

Finally, make sure that the name buffers are the same size on all
platforms. VM_MAX_NAMELEN is supposed to be the maximum, not including
the nul terminator.

Reviewed by: corvink
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D53422

(cherry picked from commit 7377c87e467343e71b3e803708b98e04ea8e84bd)

Details

Provenance
markjAuthored on Tue, Nov 4, 1:55 PM
Reviewer
corvink
Differential Revision
D53422: vmm: Consolidate VM name length checking
Parents
rG16fe30d92da3: vmm: Move the module load handler to vmm_dev.c
Branches
Unknown
Tags
Unknown