From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORL4-0008Gs-DD for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WORL2-0002KN-G3 for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:35:49 -0400 Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:47769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORL2-0002KJ-8f for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:35:48 -0400 Received: by mail-ob0-f171.google.com with SMTP id wn1so2493090obc.30 for ; Fri, 14 Mar 2014 05:35:47 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 14 Mar 2014 18:05:47 +0530 Message-ID: From: Aakriti Gupta Content-Type: multipart/alternative; boundary=089e01229a0627c06e04f4904fab Subject: [Qemu-devel] [PATCH] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Stefan Hajnoczi --089e01229a0627c06e04f4904fab Content-Type: text/plain; charset=ISO-8859-1 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 --- 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 --089e01229a0627c06e04f4904fab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
This pat= ch converts fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create(= )
(error_setg() = is part of=A0error reporting API in include/qapi/error.h)
=
Signed-off-by: Aakriti Gupta <aakritty@gmail.com>
---
=A0block/qed.c | 8 ++++----
=A01 files changed, 4 insertions(+), 4 delet= ions(-)

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<= /font>
+++ b/block/qed.c
@@ -650,18 +650,18 @@ static int bdrv_qed_cr= eate(const char *filename, QEMUOptionParameter *options,
<= font face=3D"arial, sans-serif">=A0 =A0 =A0}

=A0 =A0 =A0if (!qed_is_cluster_size_valid(cluster_size)) = {
- =A0 =A0 =A0 =A0fprint= f(stderr, "QED cluster size must be within range [%u, %u] and power of= 2\n",
+ =A0 =A0 =A0 =A0error_setg(errp, &qu= ot;QED cluster size must be within range [%u, %u] and power of 2",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0QED_MIN_CLUSTER_SIZE, QED_MAX_CLUSTER_SIZE);
=A0 =A0 =A0 =A0 =A0return -EINVAL;
=A0 =A0 =A0}
=A0 =A0 =A0if (!qed_is_table_size_valid= (table_size)) {
- =A0 =A0 =A0 =A0fprintf(stderr, &quo= t;QED table size must be within range [%u, %u] and power of 2\n",
+ =A0 =A0 =A0 =A0error_setg(e= rrp, "QED table size must be within range [%u, %u] and power of 2"= ;,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0QE= D_MIN_TABLE_SIZE, QED_MAX_TABLE_SIZE);
=A0 =A0 =A0 =A0 =A0return -EINVAL;
=A0 =A0 =A0}
=A0 =A0 =A0if (!qed_is_image_size_valid(image_size= , cluster_size, table_size)) {
- =A0 =A0 =A0 =A0fprintf(stderr, "QED image size must be a non-ze= ro multiple of "
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0"cluster size and less than %" PRIu64 " bytes\n"= ,
+ =A0 =A0 =A0 =A0error_setg(errp, "QED image size must be = a non-zero multiple of "
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"cluster size an= d less than %" PRIu64 " bytes",
=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0qed_max_image_size(cluster_size, table_size));
=A0 =A0 =A0 =A0 =A0return -EINVAL;
=A0 =A0 =A0}
--=A0
1.8.1.2


--089e01229a0627c06e04f4904fab--