qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Le Tan <tamlokveer@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, jan.kiszka@web.de, afaerber@suse.de,
	Le Tan <tamlokveer@gmail.com>
Subject: [Qemu-trivial] [PATCH 1/4] arch_init: replace fprintf(stderr, ...) with error_report() in arch_init.c
Date: Sat, 10 May 2014 07:55:19 +0800	[thread overview]
Message-ID: <148ba95b4d26522056d25fea8312b24760fe8289.1399641611.git.tamlokveer@gmail.com> (raw)
In-Reply-To: <cover.1399641611.git.tamlokveer@gmail.com>
In-Reply-To: <cover.1399641611.git.tamlokveer@gmail.com>

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 <tamlokveer@gmail.com>
---
 arch_init.c |   36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 60c975d..0b41475 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -921,12 +921,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 */
@@ -936,11 +936,11 @@ static int load_xbzrle(QEMUFile *f, ram_addr_t addr, void *host)
     ret = xbzrle_decode_buffer(xbzrle_decoded_buf, xh_len, host,
                                TARGET_PAGE_SIZE);
     if (ret == -1) {
-        fprintf(stderr, "Failed to load XBZRLE page - decode error!\n");
+        error_report("Failed to load XBZRLE page - decode error!");
         rc = -1;
     } else  if (ret > TARGET_PAGE_SIZE) {
-        fprintf(stderr, "Failed to load XBZRLE page - size %d exceeds %d!\n",
-                ret, TARGET_PAGE_SIZE);
+        error_report("Failed to load XBZRLE page - size %d exceeds %d!",
+                     ret, TARGET_PAGE_SIZE);
         abort();
     }
 
@@ -957,7 +957,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;
         }
 
@@ -973,7 +973,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;
 }
 
@@ -1026,10 +1026,10 @@ 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;
                             }
@@ -1038,8 +1038,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;
                     }
@@ -1186,12 +1186,10 @@ 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;
             }
@@ -1214,13 +1212,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.9.5



  reply	other threads:[~2014-05-10  5:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 23:55 [Qemu-trivial] [PATCH 0/4] replace some fprintf(stderr, ...) with error_report() Le Tan
2014-05-09 23:55 ` Le Tan [this message]
2014-05-24  5:41   ` [Qemu-trivial] [PATCH 1/4] arch_init: replace fprintf(stderr, ...) with error_report() in arch_init.c Le Tan
2014-05-24  5:56     ` [Qemu-trivial] [Qemu-devel] " Michael Tokarev
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 2/4] audio: replace fprintf(stderr, ...) with error_report() in audio Le Tan
2014-05-23 21:04   ` Michael Tokarev
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 3/4] block: replace fprintf(stderr, ...) with error_report() in block/ Le Tan
2014-05-10 13:18   ` [Qemu-trivial] [Qemu-devel] " Peter Crosthwaite
2014-05-11 13:27     ` Le Tan
2014-05-12  1:13       ` Peter Crosthwaite
2014-05-24  5:44     ` Le Tan
2014-05-09 23:55 ` [Qemu-trivial] [PATCH 4/4] bsd-user: replace fprintf(stderr, ...) with error_report() Le Tan
2014-05-23 21:16   ` Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148ba95b4d26522056d25fea8312b24760fe8289.1399641611.git.tamlokveer@gmail.com \
    --to=tamlokveer@gmail.com \
    --cc=afaerber@suse.de \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).