qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create()
@ 2014-03-15  9:35 Aakriti Gupta
  2014-03-17 14:59 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Aakriti Gupta @ 2014-03-15  9:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Aakriti Gupta, stefanha

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 file changed, 4 insertions(+), 4 deletions(-)

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.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create()
  2014-03-15  9:35 [Qemu-devel] [PATCH v2] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() Aakriti Gupta
@ 2014-03-17 14:59 ` Stefan Hajnoczi
  2014-03-18  9:44   ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-03-17 14:59 UTC (permalink / raw)
  To: Aakriti Gupta; +Cc: kwolf, qemu-devel

On Sat, Mar 15, 2014 at 03:05:23PM +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 file changed, 4 insertions(+), 4 deletions(-)

Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

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

Kevin: Do you want to fix up the indentation of the next line when
merging?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create()
  2014-03-17 14:59 ` Stefan Hajnoczi
@ 2014-03-18  9:44   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-03-18  9:44 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Aakriti Gupta

Am 17.03.2014 um 15:59 hat Stefan Hajnoczi geschrieben:
> On Sat, Mar 15, 2014 at 03:05:23PM +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 file changed, 4 insertions(+), 4 deletions(-)
> 
> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied to the block-next branch for qemu 2.1.

> >      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);
> 
> Kevin: Do you want to fix up the indentation of the next line when
> merging?

Sure, I did that, and wrapped the line at 80 characters, too.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-18  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-15  9:35 [Qemu-devel] [PATCH v2] convert fprintf() calls to error_setg() in block/qed.c:bdrv_qed_create() Aakriti Gupta
2014-03-17 14:59 ` Stefan Hajnoczi
2014-03-18  9:44   ` Kevin Wolf

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