Received: from eggs.gnu.org ([2001:4830:134:3::10]:36378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXp9w-00013l-Pw for qemu-devel@nongnu.org; Tue, 17 Mar 2015 06:55:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXp9t-000778-Kx for qemu-devel@nongnu.org; Tue, 17 Mar 2015 06:55:40 -0400 Received: from mga09.intel.com ([134.134.136.24]:39707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXp9t-00076w-E6 for qemu-devel@nongnu.org; Tue, 17 Mar 2015 06:55:37 -0400 Message-ID: <1426589730.3143.15.camel@mfleming-mobl1.ger.corp.intel.com> From: Matt Fleming Date: Tue, 17 Mar 2015 10:55:30 +0000 In-Reply-To: <1426515305-17766-6-git-send-email-somlo@cmu.edu> References: <1426515305-17766-1-git-send-email-somlo@cmu.edu> <1426515305-17766-6-git-send-email-somlo@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: mdroth@linux.vnet.ibm.com, rjones@redhat.com, jordan.l.justen@intel.com, qemu-devel@nongnu.org, gleb@cloudius-systems.com, gsomlo@gmail.com, kraxel@redhat.com, pbonzini@redhat.com, lersek@redhat.com On Mon, 2015-03-16 at 10:15 -0400, Gabriel L. Somlo wrote: > Allow user supplied files to be inserted into the fw_cfg > device before starting the guest. Since fw_cfg_add_file() > already disallows duplicate fw_cfg file names, qemu will > exit with an error message if the user supplies multiple > blobs with the same fw_cfg file name, or if a blob name > collides with a fw_cfg name used internally by qemu. > > Signed-off-by: Gabriel Somlo > --- > hw/nvram/fw_cfg.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ > include/hw/nvram/fw_cfg.h | 4 ++++ > qemu-options.hx | 10 ++++++++++ > vl.c | 27 ++++++++++++++++++++++++++ > 4 files changed, 89 insertions(+) [...] > +void fw_cfg_option_add(QemuOpts *opts) > +{ > + const char *name = qemu_opt_get(opts, "name"); > + const char *file = qemu_opt_get(opts, "file"); > + > + if (name == NULL || *name == '\0' || file == NULL || *file == '\0') { > + error_report("invalid argument value"); > + exit(1); > + } Just because I know I'm going to get this wrong when I start using it, can this error message mention that the fw_cfg argument is invalid, rather than being ambiguous?