All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] hmp: Replace error_report_err
@ 2017-10-19 11:16 ZhiPeng Lu
  2017-10-19 11:24 ` Dr. David Alan Gilbert
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ZhiPeng Lu @ 2017-10-19 11:16 UTC (permalink / raw)
  To: dgilbert; +Cc: qemu-trivial, ZhiPeng Lu

Use hmp_handle_error instend of error_report_err to set error.

Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
Reviewed-by: Jiyun Fan <fan.jiyun@zte.com.cn>
---
 hmp.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/hmp.c b/hmp.c
index ec61329..a03bd03 100644
--- a/hmp.c
+++ b/hmp.c
@@ -667,7 +667,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
 
     info2l = qmp_query_vnc_servers(&err);
     if (err) {
-        error_report_err(err);
+        hmp_handle_error(mon, &err);
         return;
     }
     if (!info2l) {
@@ -782,7 +782,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
 
     info = qmp_query_balloon(&err);
     if (err) {
-        error_report_err(err);
+        hmp_handle_error(mon, &err);
         return;
     }
 
@@ -1125,7 +1125,7 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
 
     data = qmp_ringbuf_read(chardev, size, false, 0, &err);
     if (err) {
-        error_report_err(err);
+        hmp_handle_error(mon, &err);
         return;
     }
 
@@ -1192,9 +1192,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
     Error *err = NULL;
 
     qmp_balloon(value, &err);
-    if (err) {
-        error_report_err(err);
-    }
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_block_resize(Monitor *mon, const QDict *qdict)
@@ -1518,10 +1516,7 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
     Error *err = NULL;
 
     qmp_migrate_set_cache_size(value, &err);
-    if (err) {
-        error_report_err(err);
-        return;
-    }
+    hmp_handle_error(mon, &err);
 }
 
 /* Kept for backwards compatibility */
@@ -1552,10 +1547,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
 
 end:
     qapi_free_MigrationCapabilityStatusList(caps);
-
-    if (err) {
-        error_report_err(err);
-    }
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
@@ -1653,9 +1645,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
  cleanup:
     qapi_free_MigrateSetParameters(p);
     visit_free(v);
-    if (err) {
-        error_report_err(err);
-    }
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
@@ -1909,7 +1899,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
 
     qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
     if (err) {
-        error_report_err(err);
+        hmp_handle_error(mon, &err);
         return;
     }
 
-- 
1.8.3.1



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

* Re: [Qemu-trivial] [PATCH] hmp: Replace error_report_err
  2017-10-19 11:16 [Qemu-trivial] [PATCH] hmp: Replace error_report_err ZhiPeng Lu
@ 2017-10-19 11:24 ` Dr. David Alan Gilbert
  2017-10-30  3:35 ` Philippe Mathieu-Daudé
  2017-10-30 18:31 ` Dr. David Alan Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2017-10-19 11:24 UTC (permalink / raw)
  To: ZhiPeng Lu; +Cc: qemu-trivial

* ZhiPeng Lu (lu.zhipeng@zte.com.cn) wrote:
> Use hmp_handle_error instend of error_report_err to set error.
> 
> Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> Reviewed-by: Jiyun Fan <fan.jiyun@zte.com.cn>


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  hmp.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/hmp.c b/hmp.c
> index ec61329..a03bd03 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -667,7 +667,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
>  
>      info2l = qmp_query_vnc_servers(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>      if (!info2l) {
> @@ -782,7 +782,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
>  
>      info = qmp_query_balloon(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1125,7 +1125,7 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
>  
>      data = qmp_ringbuf_read(chardev, size, false, 0, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1192,9 +1192,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_balloon(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_block_resize(Monitor *mon, const QDict *qdict)
> @@ -1518,10 +1516,7 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_migrate_set_cache_size(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -        return;
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  /* Kept for backwards compatibility */
> @@ -1552,10 +1547,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
>  
>  end:
>      qapi_free_MigrationCapabilityStatusList(caps);
> -
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
> @@ -1653,9 +1645,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
>   cleanup:
>      qapi_free_MigrateSetParameters(p);
>      visit_free(v);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
> @@ -1909,7 +1899,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
>  
>      qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> -- 
> 1.8.3.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


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

* Re: [Qemu-trivial] [PATCH] hmp: Replace error_report_err
  2017-10-19 11:16 [Qemu-trivial] [PATCH] hmp: Replace error_report_err ZhiPeng Lu
  2017-10-19 11:24 ` Dr. David Alan Gilbert
@ 2017-10-30  3:35 ` Philippe Mathieu-Daudé
  2017-10-30 18:31 ` Dr. David Alan Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-30  3:35 UTC (permalink / raw)
  To: ZhiPeng Lu, dgilbert; +Cc: qemu-trivial

On 10/19/2017 08:16 AM, ZhiPeng Lu wrote:
> Use hmp_handle_error instend of error_report_err to set error.
> 
> Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> Reviewed-by: Jiyun Fan <fan.jiyun@zte.com.cn>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hmp.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/hmp.c b/hmp.c
> index ec61329..a03bd03 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -667,7 +667,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
>  
>      info2l = qmp_query_vnc_servers(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>      if (!info2l) {
> @@ -782,7 +782,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
>  
>      info = qmp_query_balloon(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1125,7 +1125,7 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
>  
>      data = qmp_ringbuf_read(chardev, size, false, 0, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1192,9 +1192,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_balloon(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_block_resize(Monitor *mon, const QDict *qdict)
> @@ -1518,10 +1516,7 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_migrate_set_cache_size(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -        return;
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  /* Kept for backwards compatibility */
> @@ -1552,10 +1547,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
>  
>  end:
>      qapi_free_MigrationCapabilityStatusList(caps);
> -
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
> @@ -1653,9 +1645,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
>   cleanup:
>      qapi_free_MigrateSetParameters(p);
>      visit_free(v);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
> @@ -1909,7 +1899,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
>  
>      qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> 


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

* Re: [Qemu-trivial] [PATCH] hmp: Replace error_report_err
  2017-10-19 11:16 [Qemu-trivial] [PATCH] hmp: Replace error_report_err ZhiPeng Lu
  2017-10-19 11:24 ` Dr. David Alan Gilbert
  2017-10-30  3:35 ` Philippe Mathieu-Daudé
@ 2017-10-30 18:31 ` Dr. David Alan Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2017-10-30 18:31 UTC (permalink / raw)
  To: ZhiPeng Lu; +Cc: qemu-trivial

* ZhiPeng Lu (lu.zhipeng@zte.com.cn) wrote:
> Use hmp_handle_error instend of error_report_err to set error.
> 
> Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
> Reviewed-by: Jiyun Fan <fan.jiyun@zte.com.cn>

Queued for HMP

Dave

> ---
>  hmp.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/hmp.c b/hmp.c
> index ec61329..a03bd03 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -667,7 +667,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
>  
>      info2l = qmp_query_vnc_servers(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>      if (!info2l) {
> @@ -782,7 +782,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict)
>  
>      info = qmp_query_balloon(&err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1125,7 +1125,7 @@ void hmp_ringbuf_read(Monitor *mon, const QDict *qdict)
>  
>      data = qmp_ringbuf_read(chardev, size, false, 0, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> @@ -1192,9 +1192,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_balloon(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_block_resize(Monitor *mon, const QDict *qdict)
> @@ -1518,10 +1516,7 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
>      Error *err = NULL;
>  
>      qmp_migrate_set_cache_size(value, &err);
> -    if (err) {
> -        error_report_err(err);
> -        return;
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  /* Kept for backwards compatibility */
> @@ -1552,10 +1547,7 @@ void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
>  
>  end:
>      qapi_free_MigrationCapabilityStatusList(caps);
> -
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
> @@ -1653,9 +1645,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
>   cleanup:
>      qapi_free_MigrateSetParameters(p);
>      visit_free(v);
> -    if (err) {
> -        error_report_err(err);
> -    }
> +    hmp_handle_error(mon, &err);
>  }
>  
>  void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
> @@ -1909,7 +1899,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict)
>  
>      qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
>      if (err) {
> -        error_report_err(err);
> +        hmp_handle_error(mon, &err);
>          return;
>      }
>  
> -- 
> 1.8.3.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


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

end of thread, other threads:[~2017-10-30 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19 11:16 [Qemu-trivial] [PATCH] hmp: Replace error_report_err ZhiPeng Lu
2017-10-19 11:24 ` Dr. David Alan Gilbert
2017-10-30  3:35 ` Philippe Mathieu-Daudé
2017-10-30 18:31 ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.