Bug 234134

Summary: Increase VM_MAX_NAMELEN value
Product: Base System Reporter: Mateusz Kwiatkowski <kwiat3k>
Component: kernAssignee: Rodney W. Grimes <rgrimes>
Status: New ---    
Severity: Affects Some People CC: kwiat3k, pawel.biernacki, rgrimes, swills, virtualization
Priority: ---    
Version: 12.0-STABLE   
Hardware: amd64   
OS: Any   

Description Mateusz Kwiatkowski 2018-12-18 13:52:11 UTC
Currently VM_MAX_NAMELEN is set to 32 and thus the maximum length of virtual machine is 31 characters.
We’re building product that uses bhyve to run virtual machines and we wanted to use UUIDs as names for VMs.
UUID with hyphens has 36 characters and without it has 32 characters. Can this limit be increased to 33 and 
ideally to 37 or more characters?
For comparison qemu-kvm+libvirt allow for virtual machines with names that are over 240 chars.

I've tested hypervisor with VM_MAX_NAMELEN to 64 on stable/12 branch and didn't experience any issue.
Comment 1 Rodney W. Grimes freebsd_committer 2018-12-18 17:30:32 UTC
A little bit of code work to change this into a dynamically allocated string and then raise the limit to pathmax is probably in order.

This constant was just a fast path to deployed code.
Comment 2 Mateusz Kwiatkowski 2018-12-18 19:24:22 UTC
thank you for your answer. Are you going to work on this soon? If not can we have it just bumped to 64 for now?
Comment 3 Rodney W. Grimes freebsd_committer 2018-12-18 19:57:05 UTC
I have  bhyve work planned over the week between christmas and new years, I have also added virtualization to the CC: list, and am sending an email to have this issue added as a topic for the next bhyve conference call (early January).
Comment 4 Mateusz Kwiatkowski 2018-12-18 19:58:07 UTC
That sounds great. Thanks!
Comment 5 Mateusz Kwiatkowski 2019-02-08 09:41:27 UTC
Hi Rodney,

Did you have a chance to take a look on this issue? Thanks!
Comment 6 Rodney W. Grimes freebsd_committer 2019-02-08 15:55:57 UTC
(In reply to Mateusz Kwiatkowski from comment #5)
Some how I let this slide off the radar, this bug is now on the PR list for the bi-monthly bhyve developers call and shall be discussed at the next meeting on February 21, 2019.  As long as there are no issues with doing this I'll create a phabricator review and get this enhancement moved forward.
Comment 7 Rodney W. Grimes freebsd_committer 2019-02-21 17:31:49 UTC
(In reply to Mateusz Kwiatkowski from comment #5)
This was discussed during the bhyve developer call on 2019/02/21 and I shall be creating a patch that makes the vm name a dynamic string of size up to MAX_NAMELEN.  Look for a diffential review to be added to this PR in the next 2 weeks.
Comment 8 Mateusz Kwiatkowski 2019-05-14 16:32:26 UTC
(In reply to Rodney W. Grimes from comment #7)
Hi Rodney,

Any update on this?