Page MenuHomeFreeBSD

bhyve: Eliminate exit status magic numbers
AcceptedPublic

Authored by bnovkov on Thu, Nov 13, 11:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 16, 10:42 AM
Unknown Object (File)
Sun, Nov 16, 10:42 AM
Unknown Object (File)
Sun, Nov 16, 8:25 AM
Unknown Object (File)
Sun, Nov 16, 3:18 AM
Unknown Object (File)
Fri, Nov 14, 3:50 PM
Unknown Object (File)
Fri, Nov 14, 3:48 PM
Unknown Object (File)
Fri, Nov 14, 3:48 PM
Unknown Object (File)
Fri, Nov 14, 2:26 AM

Details

Reviewers
markj
andrew
corvink
emaste
Group Reviewers
bhyve
Summary

bhyve's exit status codes indicate how the VM was terminated.
Unfortunately, their meaning within the source code is somewhat
unclear since they are only used as magic numbers.

Fix this by defining exit status macros and using them to replace
the magic numbers in exit(3) function calls.

Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Thu, Nov 13, 3:46 PM
usr.sbin/bhyve/bhyverun.h
37

Maybe comments here and in bhyve.8 mentioning that this list also exists in the other one?

This revision now requires review to proceed.Mon, Nov 17, 2:54 PM
bnovkov added inline comments.
usr.sbin/bhyve/bhyverun.h
37

Thanks for the suggestion, I've added a reference to the manpage here.
I don't think it makes sense to reference the bhyverun.h list in the manpage.

I don't think it makes sense to reference the bhyverun.h list in the manpage.

Yes fair point, nobody is going to start with the man page to add new exit codes.

This revision is now accepted and ready to land.Mon, Nov 17, 3:06 PM