qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aakriti Gupta <aakritty@gmail.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create()
Date: Fri, 14 Mar 2014 18:05:47 +0530	[thread overview]
Message-ID: <CALRrUAFB9ad84JSXFqhWaegzKm3+BWM0vpNx8ceDRAG1f_iffQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]

This patch converts fprintf() calls to error_setg() in
block/qed.c:bdrv_qed_create()
(error_setg() is part of error reporting API in include/qapi/error.h)

Signed-off-by: Aakriti Gupta <aakritty@gmail.com>
---
 block/qed.c | 8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/VERSION b/VERSION
index 536bc46..32c79ec 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.7.50
+1.7.90
diff --git a/block/qed.c b/block/qed.c
index 837accd..01fa91b 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -650,18 +650,18 @@ static int bdrv_qed_create(const char *filename,
QEMUOptionParameter *options,
     }

     if (!qed_is_cluster_size_valid(cluster_size)) {
-        fprintf(stderr, "QED cluster size must be within range [%u, %u]
and power of 2\n",
+        error_setg(errp, "QED cluster size must be within range [%u, %u]
and power of 2",
                 QED_MIN_CLUSTER_SIZE, QED_MAX_CLUSTER_SIZE);
         return -EINVAL;
     }
     if (!qed_is_table_size_valid(table_size)) {
-        fprintf(stderr, "QED table size must be within range [%u, %u] and
power of 2\n",
+        error_setg(errp, "QED table size must be within range [%u, %u] and
power of 2",
                 QED_MIN_TABLE_SIZE, QED_MAX_TABLE_SIZE);
         return -EINVAL;
     }
     if (!qed_is_image_size_valid(image_size, cluster_size, table_size)) {
-        fprintf(stderr, "QED image size must be a non-zero multiple of "
-                        "cluster size and less than %" PRIu64 " bytes\n",
+        error_setg(errp, "QED image size must be a non-zero multiple of "
+                        "cluster size and less than %" PRIu64 " bytes",
                 qed_max_image_size(cluster_size, table_size));
         return -EINVAL;
     }
-- 
1.8.1.2

[-- Attachment #2: Type: text/html, Size: 3921 bytes --]

             reply	other threads:[~2014-03-14 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 12:35 Aakriti Gupta [this message]
2014-03-14 14:21 ` [Qemu-devel] [PATCH] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() Stefan Hajnoczi
2014-03-14 14:23 ` Stefan Hajnoczi

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=CALRrUAFB9ad84JSXFqhWaegzKm3+BWM0vpNx8ceDRAG1f_iffQ@mail.gmail.com \
    --to=aakritty@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).