runC源码分析——主体调用链
来源:互联网 发布:linux制作iso镜像 编辑:程序博客网 时间:2024/06/08 04:33
本文将简单的对runC的源码调用主体逻辑进行梳理,为跟系统的阅读runC源码。
runC总体调用逻辑
下图中,runC源码逻辑跳转流程总体上分为三步:
main入口 ——> runC处理 ——> libcontainer处理。
runC其实就是在libcontainer的基础上进行了封装成各个Command。
具体runC的各个Command的调用链见如下:
runC处理
checkpoint
checkpointCommand(main.go) —> checkpointCommand(checkpoint.go)
container
createCommand(main.go)—>createCommand(create.go)—>startContainer(untils_linux.go)—>run(untils_linux.go)
deleteCommand(main.go)—>deleteCommand(delete.go)—>destroy(untils_linux.go)
eventsCommand(main.go)—>eventsCommand(events.go)
execCommand(main.go)—>execCommand(exec.go)—>execProcess(exec.go)->run(untils_linux.go)
initCommand(main.go)—>initCommand(main_unix.go)
killCommand(main.go)—>killCommand(kill.go)
listCommand(main.go)—>getContainers(list.go)
pauseCommand(main.go) —>pauseCommand(pause.go)
psCommand(main.go)—>psCommand(ps.go)
restoreCommand(main.go)—>restoreCommand(restore.go)—>restoreContainer(restore.go)
resumeCommand(main.go)—>resumeCommand(pause.go)
runCommand(main.go)—>runCommand(run.go)—>startContainer(untils_linux.go)
specCommand(main.go)—>specCommand(spec.go) end
startCommand(main.go)—>startCommand(start.go)
stateCommand(main.go)—>stateCommand(state.go)
updateCommand(main.go)—>updateCommand(update.go)
runC to libcontainer
checkpoint
checkpointCommand(checkpoint.go)—> Checkpoint(libcontainer/container_linux.go)
container
run(untils_linux.go)—>Run(libcontainer/container_linux.go)
destroy(untils_linux.go)—>Destroy(libcontainer/container_linux.go)
eventsCommand(events.go)—>Status(libcontainer/container_linux.go)
execProcess(exec.go)—>Status\Stopped\State(libcontainer/container_linux.go) || run(untils_linux.go)—>Start\Run\Destroy(libcontainer/container_linux.go)
initCommand(main_unix.go)—>StartInitialization(libcontainer/factory_linux.go)
killCommand(kill.go)—>Signal(libcontainer/container_linux.go)
getContainers(list.go)—>Status\State\Stopped(libcontainer/container_linux.go)
pauseCommand(pause.go)—>Pause(libcontainer/container_linux.go)
psCommand(ps.go)—>exec.Command(“ps”, psArgs…).Output()
restoreContainer(restore.go)—>Restore(libcontainer/container_linux.go)
resumeCommand(pause.go)—>Resume(libcontainer/container_linux.go)
startContainer(untils_linux.go)—>Run(libcontainer/factory.go)
startCommand(start.go)—>Exec(libcontainer/container_linux.go)
stateCommand(state.go)—>State(libcontainer/container_linux.go)
updateCommand(update.go)—>Set(libcontainer/container_linux.go)
- runC源码分析——主体调用链
- runC源码分析——namespace
- runC源码分析——cgroup
- runc源码分析——create和start
- runC源码分析——Create/Run Container
- runc源码分析——create和start
- 【runc 源码分析】runc create / start 流程分析
- 【runc 源码分析】namespace 源码分析
- 【runc 源码分析】cgroup 源码分析
- docker RunC Create 源码简单分析
- docker -- 标准化容器执行引擎——runC
- 系统调用入口函数源码分析system_call——X86_64
- Openstack Nova 源码分析 — RPC 远程调用过程
- 【雅思备考】Task2——主体段
- 【开源】QuickPager ASP.NET2.0分页控件V2.0.0.1——分页控件的源码(一) 主体
- 源码编译安装runc碰到的一个小坑
- tinypy源码分析(四)——函数调用的实现分析
- 主体
- redis 基本操作
- 深度学习框架Caffe源码解析
- C++学习笔记
- grails框架入门小结(三)—Maven+Git+Dubbo+Zookeeper
- vs2008 vs2010 vs2015 菜单栏消失及恢复
- runC源码分析——主体调用链
- BZOJ 1497 最大权闭合子图
- 驽马十驾,功在不舍
- 专业与侍奉,双职侍奉 --- 黄立夫教授的体会与分享(转载)
- ASP.NET C# 过滤器
- Microsoft Visual studio2013如何编写文本代码
- java数据结构与算法之平衡二叉树(AVL树)的设计与实现
- java中null和""的区别
- Mongo-java-driver-2.12.4.jar包目录结构