From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnDQd-0000TD-7o for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:57:35 -0500 Received: from [199.232.76.173] (port=35947 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnDQc-0000RX-Jc for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:57:34 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnDQL-0000Gj-QE for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:57:31 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:39610) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NnDQL-0000Fq-6V for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:57:17 -0500 Received: from blackfin.pond.sub.org (pD9E38041.dip.t-dialin.net [217.227.128.65]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 5355E276DA8 for ; Thu, 4 Mar 2010 16:57:12 +0100 (CET) From: Markus Armbruster Date: Thu, 4 Mar 2010 16:56:24 +0100 Message-Id: <1267718231-13303-4-git-send-email-armbru@redhat.com> In-Reply-To: <1267718231-13303-1-git-send-email-armbru@redhat.com> References: <1267718231-13303-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 03/50] pc: Fix error reporting for -boot once List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Luiz Capitulino Commit 0ecdffbb created pc_boot_set() for use from monitor command "boot_set", via qemu_boot_set(). pc_boot_set() reports errors to cur_mon, which works fine for monitor code. Commit e0f084bf reused the function int reset handler restore_boot_devices(). Use of cur_mon is problematic in that context. For instance, the "Too many boot devices for PC" error for "-boot order=abcdefgh,once=c" goes to the monitor instead of stderr. The monitor may not even exist. Fix by switching to qemu_error(). Signed-off-by: Markus Armbruster --- hw/pc.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 4f6a522..d94980b 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -234,7 +234,6 @@ static int boot_device2nibble(char boot_device) and used there as well */ static int pc_boot_set(void *opaque, const char *boot_device) { - Monitor *mon = cur_mon; #define PC_MAX_BOOT_DEVICES 3 RTCState *s = (RTCState *)opaque; int nbds, bds[3] = { 0, }; @@ -242,14 +241,14 @@ static int pc_boot_set(void *opaque, const char *boot_device) nbds = strlen(boot_device); if (nbds > PC_MAX_BOOT_DEVICES) { - monitor_printf(mon, "Too many boot devices for PC\n"); + qemu_error("Too many boot devices for PC\n"); return(1); } for (i = 0; i < nbds; i++) { bds[i] = boot_device2nibble(boot_device[i]); if (bds[i] == 0) { - monitor_printf(mon, "Invalid boot device for PC: '%c'\n", - boot_device[i]); + qemu_error("Invalid boot device for PC: '%c'\n", + boot_device[i]); return(1); } } -- 1.6.6.1