Page MenuHomeFreeBSD

bhyve: use linker set for ipc commands
ClosedPublic

Authored by rew on Apr 3 2022, 7:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 27, 4:05 AM
Unknown Object (File)
Dec 13 2024, 12:06 AM
Unknown Object (File)
Dec 8 2024, 11:19 AM
Unknown Object (File)
Dec 3 2024, 7:34 AM
Unknown Object (File)
Nov 26 2024, 9:21 AM
Unknown Object (File)
Nov 26 2024, 2:43 AM
Unknown Object (File)
Nov 3 2024, 10:17 AM
Unknown Object (File)
Nov 2 2024, 12:52 PM

Diff Detail

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

Event Timeline

rew requested review of this revision.Apr 3 2022, 7:18 PM
usr.sbin/bhyve/snapshot.c
1465

This suggestion will be saved for a different review...but I'm thinking this is where the response nvlist will be constructed to return the results back to the sender. Unless someone has a different idea?

markj added a subscriber: markj.
markj added inline comments.
usr.sbin/bhyve/snapshot.c
1439

You might add a IPC_COMMAND_FOREACH macro to ipc.h so that all the code that directly uses linker_set.h is in one place.

This revision is now accepted and ready to land.Apr 6 2022, 9:05 PM
jhb added a subscriber: jhb.
jhb added inline comments.
usr.sbin/bhyve/ipc.h
38

Perhaps const nvlist_t *nvl? I don't think the handlers should be modifying the nvlist.

usr.sbin/bhyve/snapshot.c
1465

Perhaps, though you would maybe want the error value so you might have handle_message() generate the nvlist that it writes back out on the socket (or return a the reply nvlist here).

usr.sbin/bhyve/ipc.h
38

I suppose it depends on how fine-grained the reply nvlist should be?

If handler functions want to return custom error messages and/or translate return values from their callback....then I could see the handler function reusing the nvlist pointer as the reply nvlist. If the callback in the handler function fails, the handler function would still construct the reply nvlist and return success. If the handler function returns failure (i.e., the callback wasn't called), the caller of the handler function would then be responsible for creating the reply nvlist.

or..?

This revision was automatically updated to reflect the committed changes.
usr.sbin/bhyve/ipc.h
38

I would add a new parameter to support a reply nvlist that starts out as empty. I would then make the common code that invokes handler append the handler's return value to this nvlist as the error code (using a "standard" name shared across all replies) and then send the reply nvlist in reply.