Conversation
Header hygiene:
- Move internal headers (fd-table.h, lkl-wrap.h, seccomp{,-defs}.h,
shadow-fd.h, procmem.h, net.h, web.h, syscall-nr.h) from include/kbox
to src/ to reduce public API surface
- Delete dead util.h/util.c (zero callers)
- Make file-local functions static in path.c, lkl-wrap.c, web-server.c
- Add KBOX_FD_TABLE_CAPACITY macro, kbox_fd_table_count(),
kbox_web_set_fd_used()
- Refactor kbox_host_nrs to X-macro (KBOX_HOST_NR_FIELDS) for single
source of truth between struct definition and syscall_name_from_nr()
Dead code elimination:
- Delete dead static wrappers from lkl-wrap.c (kbox_ensure_dev_console,
kbox_lkl_dup3, kbox_lkl_execve, kbox_lkl_exit, kbox_lkl_wait4, etc.)
- Delete dead process-event pipeline (kbox_web_record_process,
kbox_event_push_process, KBOX_EVT_PROCESS, struct kbox_process_event)
- Delete dead KBOX_EVT_COUNTER_DELTA enum and handler
- Delete dead forward_sendmsg (marked __attribute__((unused)))
- Remove unused slow_sample_ms config field
- Consolidate duplicate ELF parsing (kbox_parse_elf_interp delegates to
kbox_find_elf_interp_loc)
Change-Id: I49da244c7d3c9eefd6abeed616f55dda064c3bbb
The CI LKL nightly build may lack CONFIG_DEVTMPFS or CONFIG_DEVPTS_FS (olddefconfig can silently drop configs when upstream dependencies change). This caused boot-and-exit to fail with "mount(devtmpfs on /dev): No such device", breaking the entire integration test suite. Guest can operate without devtmpfs and devpts; warn instead of aborting. proc, sysfs, and tmpfs remain fatal since they are required for core kbox functionality. Change-Id: Ief46d361d22c36cf2691786a770e371fc1d356ad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Header hygiene:
Dead code elimination:
Change-Id: I49da244c7d3c9eefd6abeed616f55dda064c3bbb
Summary by cubic
Reduces the public C header surface and strips dead code to simplify the build and maintenance. Also makes devtmpfs/devpts mount failures non‑fatal so image boot works on lean LKL builds.
Refactors
include/kboxtosrc/(e.g.,fd-table.h,lkl-wrap.h,seccomp{,-defs}.h,shadow-fd.h,procmem.h,net.h,web.h,syscall-nr.h); updatedMakefileand pre-commit to include-Isrc.staticinpath.c,lkl-wrap.c, andweb-server.c.KBOX_FD_TABLE_CAPACITY,kbox_fd_table_count(), andkbox_web_set_fd_used().kbox_host_nrsto theKBOX_HOST_NR_FIELDSX-macro and integrated withsyscall_name_from_nr().proc,sysfs, andtmpfsremain fatal.Dead Code Removal
util.h/util.cand unused wrappers fromlkl-wrap.c(e.g.,kbox_ensure_dev_console,kbox_lkl_dup3,kbox_lkl_execve,kbox_lkl_exit,kbox_lkl_wait4, etc.).KBOX_EVT_PROCESS,KBOX_EVT_COUNTER_DELTA, and handlers).forward_sendmsgand the unusedslow_sample_msconfig.Written for commit a2ba2d2. Summary will update on new commits.