diff mbox

convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create()

Message ID CALRrUAFB9ad84JSXFqhWaegzKm3+BWM0vpNx8ceDRAG1f_iffQ@mail.gmail.com
State New
Headers show

Commit Message

Aakriti Gupta March 14, 2014, 12:35 p.m. UTC
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(-)

-        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;
     }

Comments

Stefan Hajnoczi March 14, 2014, 2:21 p.m. UTC | #1
On Fri, Mar 14, 2014 at 06:05:47PM +0530, Aakriti Gupta wrote:
> 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

This snuck into the patch.  Please drop it, double-check the commit is
clean using git-show(1), and send another revision of this patch using
git-send-email --subject-prefix 'PATCH v2' ....

Thanks,
Stefan
Stefan Hajnoczi March 14, 2014, 2:23 p.m. UTC | #2
On Fri, Mar 14, 2014 at 06:05:47PM +0530, Aakriti Gupta wrote:
> @@ -650,18 +650,18 @@ static int bdrv_qed_create(const char *filename,
> QEMUOptionParameter *options,

I just noticed that the email is line-wrapped.

Please do not copy-paste patches into GMail.  The GMail web interface
always wraps lines, there is no way to disable this and it breaks
git-am(1) so I cannot apply the patch.

Instead, please use git-send-email(1):
"We recommend git send-email because mail clients often mangle patches
by wrapping long lines or messing up whitespace"
http://qemu-project.org/Contribute/SubmitAPatch

Stefan
diff mbox

Patch

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)) {