Page MenuHomeFreeBSD

bhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM
ClosedPublic

Authored by rew on Feb 28 2021, 10:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 1:26 AM
Unknown Object (File)
Mar 16 2024, 2:00 AM
Unknown Object (File)
Mar 16 2024, 2:00 AM
Unknown Object (File)
Mar 16 2024, 2:00 AM
Unknown Object (File)
Mar 12 2024, 6:14 AM
Unknown Object (File)
Mar 8 2024, 5:01 AM
Unknown Object (File)
Mar 7 2024, 8:43 PM
Unknown Object (File)
Feb 19 2024, 9:36 AM

Details

Summary

The unix domain socket that the save/restore feature uses is a stream
socket, switch to using a datagram socket instead.

  • change socket type from SOCK_STREAM to SOCK_DGRAM

Currently, struct checkpoint_op is the data that gets sent across the
socket. My idea (at the moment) is that checkpoint_op will be swapped
out for a more generic approach - I'm planning to do that in a separate
review.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37455
Build 34344: arc lint + arc unit

Event Timeline

rew requested review of this revision.Feb 28 2021, 10:09 AM

Generally looks good, just a minor nit about displaying errors.

usr.sbin/bhyve/snapshot.c
1488

This probably needs to use the helper macro for errors which adds \r when needed if bhyve's stdin/stdout are in raw mode for use as the serial console. It's true that the perror's in this file are also broken for the same reason, but it would be good to fix this in the new changes at least. I think the macro is something like EPRINTLN() IIRC.

use EPRINTLN for display error messages..

changed fprintf and perror to use EPRINTLN, I only changed them in
the areas where I was close to a fprintf/perror.

jhb added inline comments.
usr.sbin/bhyvectl/bhyvectl.c
1716

Maybe fix this one as well since you are already touching the line.

This revision is now accepted and ready to land.Mar 3 2021, 10:11 PM
usr.sbin/bhyvectl/bhyvectl.c
1716

perror() is only broken for bhyve(8), no?

This one is in bhyvectl(8).

usr.sbin/bhyvectl/bhyvectl.c
1716

Oh yes, my bad!