From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYUyz-0001qs-5E for qemu-devel@nongnu.org; Thu, 19 Mar 2015 03:35:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYUyv-0001GY-4t for qemu-devel@nongnu.org; Thu, 19 Mar 2015 03:35:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYUyu-0001Fl-W5 for qemu-devel@nongnu.org; Thu, 19 Mar 2015 03:35:05 -0400 Message-ID: <1426750498.18873.13.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Thu, 19 Mar 2015 08:34:58 +0100 In-Reply-To: <20150318202703.GM1832@HEDWIG.INI.CMU.EDU> References: <1426515305-17766-1-git-send-email-somlo@cmu.edu> <1426515305-17766-6-git-send-email-somlo@cmu.edu> <55080FD4.4020406@redhat.com> <20150318202703.GM1832@HEDWIG.INI.CMU.EDU> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: matt.fleming@intel.com, mdroth@linux.vnet.ibm.com, rjones@redhat.com, jordan.l.justen@intel.com, "Gabriel L. Somlo" , qemu-devel@nongnu.org, gleb@cloudius-systems.com, pbonzini@redhat.com, Laszlo Ersek , Markus Armbruster 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