[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 09/23] arch_init: replace fprintf(stderr, ...) with
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 09/23] arch_init: replace fprintf(stderr, ...) with error_report() |
Date: |
Mon, 26 May 2014 11:19:57 +0400 |
From: Le Tan <address@hidden>
Replace fprintf(stderr,...) with error_report() in the file
arch_init.c. The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.
Signed-off-by: Le Tan <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
arch_init.c | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 685ba0e..9f1a174 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -975,12 +975,12 @@ static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void
*host)
xh_len = qemu_get_be16(f);
if (xh_flags != ENCODING_FLAG_XBZRLE) {
- fprintf(stderr, "Failed to load XBZRLE page - wrong compression!\n");
+ error_report("Failed to load XBZRLE page - wrong compression!");
return -1;
}
if (xh_len > TARGET_PAGE_SIZE) {
- fprintf(stderr, "Failed to load XBZRLE page - len overflow!\n");
+ error_report("Failed to load XBZRLE page - len overflow!");
return -1;
}
/* load data and decode */
@@ -989,7 +989,7 @@ static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void
*host)
/* decode RLE */
if (xbzrle_decode_buffer(xbzrle_decoded_buf, xh_len, host,
TARGET_PAGE_SIZE) == -1) {
- fprintf(stderr, "Failed to load XBZRLE page - decode error!\n");
+ error_report("Failed to load XBZRLE page - decode error!");
return -1;
}
@@ -1006,7 +1006,7 @@ static inline void *host_from_stream_offset(QEMUFile *f,
if (flags & RAM_SAVE_FLAG_CONTINUE) {
if (!block) {
- fprintf(stderr, "Ack, bad migration stream!\n");
+ error_report("Ack, bad migration stream!");
return NULL;
}
@@ -1022,7 +1022,7 @@ static inline void *host_from_stream_offset(QEMUFile *f,
return memory_region_get_ram_ptr(block->mr) + offset;
}
- fprintf(stderr, "Can't find block %s!\n", id);
+ error_report("Can't find block %s!", id);
return NULL;
}
@@ -1075,10 +1075,9 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
if (!strncmp(id, block->idstr, sizeof(id))) {
if (block->length != length) {
- fprintf(stderr,
- "Length mismatch: %s: " RAM_ADDR_FMT
- " in != " RAM_ADDR_FMT "\n", id, length,
- block->length);
+ error_report("Length mismatch: %s: " RAM_ADDR_FMT
+ " in != " RAM_ADDR_FMT, id, length,
+ block->length);
ret = -EINVAL;
goto done;
}
@@ -1087,8 +1086,8 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
}
if (!block) {
- fprintf(stderr, "Unknown ramblock \"%s\", cannot "
- "accept migration\n", id);
+ error_report("Unknown ramblock \"%s\", cannot "
+ "accept migration", id);
ret = -EINVAL;
goto done;
}
@@ -1243,12 +1242,11 @@ void select_soundhw(const char *optarg)
if (!c->name) {
if (l > 80) {
- fprintf(stderr,
- "Unknown sound card name (too big to show)\n");
+ error_report("Unknown sound card name (too big to show)");
}
else {
- fprintf(stderr, "Unknown sound card name `%.*s'\n",
- (int) l, p);
+ error_report("Unknown sound card name `%.*s'",
+ (int) l, p);
}
bad_card = 1;
}
@@ -1271,13 +1269,13 @@ void audio_init(void)
if (c->enabled) {
if (c->isa) {
if (!isa_bus) {
- fprintf(stderr, "ISA bus not available for %s\n", c->name);
+ error_report("ISA bus not available for %s", c->name);
exit(1);
}
c->init.init_isa(isa_bus);
} else {
if (!pci_bus) {
- fprintf(stderr, "PCI bus not available for %s\n", c->name);
+ error_report("PCI bus not available for %s", c->name);
exit(1);
}
c->init.init_pci(pci_bus);
--
1.7.10.4
- [Qemu-trivial] [PULL 04/23] nbd: Miscellaneous typo fixes., (continued)
- [Qemu-trivial] [PULL 04/23] nbd: Miscellaneous typo fixes., Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 07/23] jazz_led: Add missing break in switch case, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 01/23] libcacard: g_malloc cleanups, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 08/23] pci: move dereferencing of root only after verifying valid root pointer, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 10/23] dma-helpers: avoid calling dma_bdrv_unmap() twice, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 13/23] libcacard/vscclient: Bury some dead code, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 21/23] bsd-user: replace fprintf(stderr, ...) with error_report(), Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 20/23] audio: replace fprintf(stderr, ...) with error_report() in audio, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 19/23] libcacard: fix wrong array expansion logic, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 14/23] libcacard: Plug memory leaks around vreader_get_reader_list(), Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 09/23] arch_init: replace fprintf(stderr, ...) with error_report(),
Michael Tokarev <=
- [Qemu-trivial] [PULL 15/23] libcacard/vreader: Drop broken recovery from failed assertion, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 16/23] libcacard/vreader: Tighten assertion to clarify intent, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 23/23] libcacard: remove useless initializers, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 12/23] vl: fix 'name' option to work with -readconfig, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 06/23] bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 17/23] libcacard: Convert two leftover realloc() to GLib, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 22/23] net: cadence_gem: Fix top comment, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 03/23] nbd: Close socket on negotiation failure., Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 18/23] libcacard/vcard_emul_nss: Drop a redundant conditional, Michael Tokarev, 2014/05/26
- [Qemu-trivial] [PULL 11/23] configure: Put tempfiles in a subdir of the build directory, Michael Tokarev, 2014/05/26