qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
To: qemu-devel@nongnu.org
Cc: zhanghailiang <zhang.zhanghailiang@huawei.com>,
	luonengjun@huawei.com, peter.huangpeng@huawei.com,
	armbru@redhat.com, lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH v8 0/2] Return error reasons to caller when calling qmp_dump_guest_memory
Date: Thu, 9 Oct 2014 14:13:09 +0800	[thread overview]
Message-ID: <1412835191-15360-1-git-send-email-zhang.zhanghailiang@huawei.com> (raw)

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. 

v7 -> v8
- fixes for Eric's findings
- Add Reviewed-by
v6 -> v7
- Change the commit message for the first patch (Markus Armbruster)
- Add Reviewed-by
- Remove redundant check for local_err (Markus Armbruster)
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)

Thanks for review!;)

zhanghailiang (2):
  dump: Propagate errors into qmp_dump_guest_memory()
  dump: Turn some functions to void to make code cleaner

 dump.c | 383 ++++++++++++++++++++++++++++++-----------------------------------
 1 file changed, 177 insertions(+), 206 deletions(-)

-- 
1.7.12.4

             reply	other threads:[~2014-10-09  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09  6:13 zhanghailiang [this message]
2014-10-09  6:13 ` [Qemu-devel] [PATCH v8 1/2] dump: Propagate errors into qmp_dump_guest_memory() zhanghailiang
2014-10-09  6:13 ` [Qemu-devel] [PATCH v8 2/2] dump: Turn some functions to void to make code cleaner zhanghailiang
2014-10-09 14:21 ` [Qemu-devel] [PATCH v8 0/2] Return error reasons to caller when calling qmp_dump_guest_memory Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412835191-15360-1-git-send-email-zhang.zhanghailiang@huawei.com \
    --to=zhang.zhanghailiang@huawei.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).