From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44659 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q85V2-0002AK-B8 for qemu-devel@nongnu.org; Fri, 08 Apr 2011 02:49:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q85V0-0005te-7a for qemu-devel@nongnu.org; Fri, 08 Apr 2011 02:48:55 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]:38502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q85Uz-0005tY-W7 for qemu-devel@nongnu.org; Fri, 08 Apr 2011 02:48:54 -0400 Date: Fri, 8 Apr 2011 08:48:51 +0200 From: Adam Lackorzynski Subject: Re: [Qemu-devel] [PATCH] multiboot: Quote filename in error message. Message-ID: <20110408064851.GA5141@os.inf.tu-dresden.de> References: <1302200539-22908-1-git-send-email-adam@os.inf.tu-dresden.de> <92C880AE-D547-4A8B-89AB-99ABF3BCE159@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <92C880AE-D547-4A8B-89AB-99ABF3BCE159@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On Fri Apr 08, 2011 at 00:44:36 +0200, Alexander Graf wrote: > > On 07.04.2011, at 20:22, Adam Lackorzynski wrote: > > > Quote filename in error message to spot possible whitespace character in > > the filename. > > > > Signed-off-by: Adam Lackorzynski > > --- > > hw/multiboot.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/hw/multiboot.c b/hw/multiboot.c > > index 0d2bfb4..6be6fa0 100644 > > --- a/hw/multiboot.c > > +++ b/hw/multiboot.c > > @@ -272,7 +272,7 @@ int load_multiboot(void *fw_cfg, > > mb_debug("multiboot loading module: %s\n", initrd_filename); > > mb_mod_length = get_image_size(initrd_filename); > > if (mb_mod_length < 0) { > > - fprintf(stderr, "failed to get %s image size\n", initrd_filename); > > + fprintf(stderr, "failed to get image size of '%s'\n", initrd_filename); > > I'd like to see something telling the user that the most likely reason is that the file isn't there :). It might even make sense to only say "Failed to open file '%s'". Looking at get_image_size() it's the right thing to do... Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/