tools/testing/selftests/vfio/scripts/cleanup.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/vfio/scripts/cleanup.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/vfio/scripts/cleanup.sh- Extension
.sh- Size
- 797 bytes
- Lines
- 42
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function cleanup_devicesfunction main
Annotated Snippet
function cleanup_devices() {
local device_bdf
local device_dir
for device_bdf in "$@"; do
device_dir=${DEVICES_DIR}/${device_bdf}
if [ -f ${device_dir}/vfio-pci ]; then
unbind ${device_bdf} vfio-pci
fi
if [ -f ${device_dir}/driver_override ]; then
clear_driver_override ${device_bdf}
fi
if [ -f ${device_dir}/driver ]; then
bind ${device_bdf} $(cat ${device_dir}/driver)
fi
if [ -f ${device_dir}/sriov_numvfs ]; then
set_sriov_numvfs ${device_bdf} $(cat ${device_dir}/sriov_numvfs)
fi
rm -rf ${device_dir}
done
}
function main() {
if [ $# = 0 ]; then
cleanup_devices $(ls ${DEVICES_DIR})
rmdir ${DEVICES_DIR}
else
cleanup_devices "$@"
fi
}
main "$@"
Annotation
- Detected declarations: `function cleanup_devices`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.