Received: from eggs.gnu.org ([2001:4830:134:3::10]:59465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXsBg-00019r-Jj for qemu-devel@nongnu.org; Tue, 17 Mar 2015 10:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXsBc-0008FT-9E for qemu-devel@nongnu.org; Tue, 17 Mar 2015 10:09:40 -0400 Received: from mail-qc0-x22b.google.com ([2607:f8b0:400d:c01::22b]:33885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXsBc-0008FM-4h for qemu-devel@nongnu.org; Tue, 17 Mar 2015 10:09:36 -0400 Received: by qcaz10 with SMTP id z10so9122485qca.1 for ; Tue, 17 Mar 2015 07:09:35 -0700 (PDT) Date: Tue, 17 Mar 2015 10:09:33 -0400 From: "Gabriel L. Somlo" Message-ID: <20150317140932.GF1832@HEDWIG.INI.CMU.EDU> References: <1426515305-17766-1-git-send-email-somlo@cmu.edu> <1426515305-17766-6-git-send-email-somlo@cmu.edu> <1426589730.3143.15.camel@mfleming-mobl1.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426589730.3143.15.camel@mfleming-mobl1.ger.corp.intel.com> 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: Matt Fleming Cc: mdroth@linux.vnet.ibm.com, rjones@redhat.com, jordan.l.justen@intel.com, "Gabriel L. Somlo" , qemu-devel@nongnu.org, gleb@cloudius-systems.com, kraxel@redhat.com, pbonzini@redhat.com, lersek@redhat.com Matt, On Tue, Mar 17, 2015 at 10:55:30AM +0000, Matt Fleming wrote: > > +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? With a command line containing e.g. "-fw_cfg file=,name=" to trigger that error, the full error message ends up reading like this: qemu-system-x86_64: -fw_cfg file=,name=: invalid argument value So I figured anything more specific would end up repeating "fw_cfg" too many times on the same line of output... :) What do you think ? Thanks, --Gabriel