From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeKXq-0006Ze-2J for qemu-devel@nongnu.org; Wed, 15 Oct 2014 05:07:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeKXg-00073g-PR for qemu-devel@nongnu.org; Wed, 15 Oct 2014 05:06:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeKXg-000731-Hy for qemu-devel@nongnu.org; Wed, 15 Oct 2014 05:06:48 -0400 From: Gerd Hoffmann Date: Wed, 15 Oct 2014 11:06:07 +0200 Message-Id: <1413363967-2489-35-git-send-email-kraxel@redhat.com> In-Reply-To: <1413363967-2489-1-git-send-email-kraxel@redhat.com> References: <1413363967-2489-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 34/34] bootindex: change fprintf to error_report List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gonglei , Gerd Hoffmann From: Gonglei The function may be called by qmp command, we should report error message to the caller. Signed-off-by: Gonglei Signed-off-by: Gerd Hoffmann --- bootdevice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootdevice.c b/bootdevice.c index 56b1952..b29970c 100644 --- a/bootdevice.c +++ b/bootdevice.c @@ -24,6 +24,7 @@ #include "sysemu/sysemu.h" #include "qapi/visitor.h" +#include "qemu/error-report.h" typedef struct FWBootEntry FWBootEntry; @@ -93,7 +94,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, QTAILQ_FOREACH(i, &fw_boot_order, link) { if (i->bootindex == bootindex) { - fprintf(stderr, "Two devices with same boot index %d\n", bootindex); + error_report("Two devices with same boot index %d", bootindex); exit(1); } else if (i->bootindex < bootindex) { continue; -- 1.8.3.1