From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcEcn-000552-53 for qemu-devel@nongnu.org; Thu, 09 Oct 2014 10:23:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcEch-00046Q-KI for qemu-devel@nongnu.org; Thu, 09 Oct 2014 10:23:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcEch-00045q-Bg for qemu-devel@nongnu.org; Thu, 09 Oct 2014 10:23:19 -0400 Date: Thu, 9 Oct 2014 10:21:55 -0400 From: Luiz Capitulino Message-ID: <20141009102155.4763b229@redhat.com> In-Reply-To: <1412835191-15360-1-git-send-email-zhang.zhanghailiang@huawei.com> References: <1412835191-15360-1-git-send-email-zhang.zhanghailiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v8 0/2] Return error reasons to caller when calling qmp_dump_guest_memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang Cc: luonengjun@huawei.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, armbru@redhat.com On Thu, 9 Oct 2014 14:13:09 +0800 zhanghailiang wrote: > 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. Applied to the qmp branch, thanks. > > 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(-) >