Hi, > + case QEMU_OPTION_fwcfg: > + opts = qemu_opts_parse(qemu_find_opts("fw_cfg"), optarg, 0); > + if (opts == NULL) { > + exit(1); > + }
That is fine here. > + fw_cfg_option_add(opts); That should be called later. There is qemu_opts_foreach() to loop over all QemuOpts added, you'll find other calls of this in main(). And when called late enough (after fw_cfg init) you don't need the separate insert function any more. Testcase: (1) qemu -fw_cfg $options -writeconfig fw_cfg_test.cfg (2) qemu -readconfig fw_cfg_test.cfg Both (1) and (2) should give the same result. cheers, Gerd