qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v6 0/2] dump: let dump_error return error reason to caller
@ 2014-09-19  6:43 zhanghailiang
  2014-09-19  6:43 ` [Qemu-devel] [PATCH v6 1/2] dump: let dump_error return error info " zhanghailiang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: zhanghailiang @ 2014-09-19  6:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: zhanghailiang, luonengjun, peter.huangpeng, armbru, lcapitulino,
	lersek

Hi,

In original code, Function dump_error ignores its second parameter which contains
error reason, it is better to return the error message to the caller.

Here we use error_setg to return the error info to caller.
And at the same time, we turn functions like write_elf64_note() to void,
Because functions shouldn't return an error code _and_ an Error object.
After this modification the code will be more clean. 

v5 -> v6
- Don't check *errp directly, if errp is NULL, there will be an error,
  Instead, check a local variable *local_err (Markus Armbruster) 
v4 -> v5:
- Turn functions like write_elf64_note() to void (Luiz Capitulino)
v3 -> v4:
- Adjust the errp argument to the end 
- Remove trailing '.' in error messages
v2 -> v3:
- Drop the '\n' in the message when call dump_error(Eric Blake) 
v1 -> v2:
- Return the error reason to the caller (Luiz Capitulino)

zhanghailiang (2):
  dump: let dump_error return error info to caller
  dump: Don't return error code when return an Error object

 dump.c | 382 +++++++++++++++++++++++++++++++----------------------------------
 1 file changed, 182 insertions(+), 200 deletions(-)

-- 
1.7.12.4

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

end of thread, other threads:[~2014-09-30  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19  6:43 [Qemu-devel] [PATCH v6 0/2] dump: let dump_error return error reason to caller zhanghailiang
2014-09-19  6:43 ` [Qemu-devel] [PATCH v6 1/2] dump: let dump_error return error info " zhanghailiang
2014-09-29  7:48   ` Markus Armbruster
2014-09-29  8:06     ` zhanghailiang
2014-09-19  6:43 ` [Qemu-devel] [PATCH v6 2/2] dump: Don't return error code when return an Error object zhanghailiang
2014-09-29  8:06   ` Markus Armbruster
2014-09-30  8:39     ` zhanghailiang
2014-09-24  0:39 ` [Qemu-devel] [PATCH v6 0/2] dump: let dump_error return error reason to caller zhanghailiang
2014-09-28  1:18   ` zhanghailiang

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