Skip to content

Commit

Permalink
bootindex: change fprintf to error_report
Browse files Browse the repository at this point in the history
The function may be called by qmp command, we should
report error message to the caller.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
gongleiarei authored and kraxel committed Oct 15, 2014
1 parent 4aca8a8 commit 54086fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bootdevice.c
Expand Up @@ -24,6 +24,7 @@

#include "sysemu/sysemu.h"
#include "qapi/visitor.h"
#include "qemu/error-report.h"

typedef struct FWBootEntry FWBootEntry;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 54086fe

Please sign in to comment.