From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0Efj-0004gi-Ij for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0Eff-0008BY-0k for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:13:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0Efe-0008BQ-Os for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:13:02 -0500 Message-ID: <52CAF223.8090408@redhat.com> Date: Mon, 06 Jan 2014 19:12:51 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <1388906864-1083-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1388906864-1083-4-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1388906864-1083-4-git-send-email-qiaonuohan@cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 03/11] dump: Add API to write vmcore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qiao Nuohan Cc: stefanha@gmail.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, kumagai-atsushi@mxc.nes.nec.co.jp, anderson@redhat.com, akong@redhat.com, afaerber@suse.de On 01/05/14 08:27, Qiao Nuohan wrote: > Function is used to write vmcore. If flag_flatten is specified, flatten format > will be used. In flatten format, data is written block by block in vmcore. > struct MakedumpfileDataHeader is used to indicate the offset and size of a data > block. > > struct MakedumpfileDataHeader { > int64_t offset; > int64_t buf_size; > }; > > Signed-off-by: Qiao Nuohan > --- > dump.c | 28 ++++++++++++++++++++++++++++ > 1 files changed, 28 insertions(+), 0 deletions(-) > > diff --git a/dump.c b/dump.c > index 89baeab..764db39 100644 > --- a/dump.c > +++ b/dump.c > @@ -726,6 +726,34 @@ static int write_end_flat_header(int fd) > return 0; > } > > +static int write_buffer(int fd, bool flag_flatten, off_t offset, void *buf, > + size_t size) > +{ You might have wanted to const-qualify "*buf" here, but it certainly doesn't warrant a respin. Reviewed-by: Laszlo Ersek