From: Gonglei Date: Tue, 7 Oct 2014 08:00:38 +0000 (+0800) Subject: bootindex: change fprintf to error_report X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=54086fe5d2c562a3173126d9991bd064faf1e884;p=qemu.git bootindex: change fprintf to error_report 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 --- diff --git a/bootdevice.c b/bootdevice.c index 56b19529b1..b29970c7a3 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;