接前一篇文章:QEMU源码全解析5 —— QEMU参数解析(5)
本文内容参考:
《趣谈Linux操作系统》 —— 刘超,极客时间
《QEMU/KVM》源码解析与应用 —— 李强,机械工业出版社
特此致谢!
上一回说到了qemu_opts_parse_noisily函数只是简单调用了opt_parse函数,opt_parse函数解析出一个QemuOpts。本文对opt_parse函数进行详解。
为了便于理解,先再贴一下qemu_opts_parse_noisily函数代码,在util/qemu-option.c中,代码如下:
/**
* Create a QemuOpts in @list and with options parsed from @params.
* If @permit_abbrev, the first key=value in @params may omit key=,
* and is treated as if key was @list->implied_opt_name.
* Report errors with error_report_err(). This is inappropriate in
* QMP context. Do not use this function there!
* Return