I often use Screen Sharing on macOS for the bhyve VNC console. While I'm opening multiple screens for each VM, I hardly select the correct screen that I want to see. Because all the screen names are "bhyve". I would like to insert the VM name as the screen title.
Details
- Reviewers
markj - Group Reviewers
bhyve - Commits
- rG7e8473273f02: bhyve: insert VM name to the VNC screen title
rG0e7f8abb4526: bhyve: insert VM name to the VNC screen title
The VM name is shown at the VNC screen title like "bhyve:<vm name>". (<vm name> should be replaced with your VM name.)
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
usr.sbin/bhyve/rfb.c | ||
---|---|---|
280 | Rather than allocating the string here each time one connects and trying to handle allocation failure, IMO it'd be better to allocate the string once in rfb_init(), and just keep a pointer in struct rfb_softc. If the allocation fails, handle it in rfb_init() like we do with other errors. |
usr.sbin/bhyve/rfb.c | ||
---|---|---|
280 | OK. It's a nice idea. I'll move asprintf() allocation to rfb_init(). |
I moved the screen name initialization into the rfb_init() function and hold the title name on the rfb_softc.
I added an argument of rfb_softc to the rfb_send_server_init_msg() function to pass the title name.
To be consistent with the other *_msg() function, rfb_send_server_init_msg() should have 2 arguments, rfb_softc and the cfd socket.
Looks ok to me. IMO it is unnecessary to store the string length in the softc, but it's ok.