From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UywI9-0005Nh-CK for qemu-devel@nongnu.org; Mon, 15 Jul 2013 23:51:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UywI7-0003K9-2a for qemu-devel@nongnu.org; Mon, 15 Jul 2013 23:51:09 -0400 Received: from [222.73.24.84] (port=42308 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UywI6-0003Iw-Ny for qemu-devel@nongnu.org; Mon, 15 Jul 2013 23:51:07 -0400 Message-ID: <51E4C2F3.1000008@cn.fujitsu.com> Date: Tue, 16 Jul 2013 11:50:11 +0800 From: Qiao Nuohan MIME-Version: 1.0 References: <1373355014-14846-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1373355014-14846-3-git-send-email-qiaonuohan@cn.fujitsu.com> <20130716020644.GA32278@stefanha-thinkpad.redhat.com> In-Reply-To: <20130716020644.GA32278@stefanha-thinkpad.redhat.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Subject: Re: [Qemu-devel] [PATCH v5 2/9] dump: Add API to write header of flatten format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com, zhangxh@cn.fujitsu.com, anderson@redhat.com, kumagai-atsushi@mxc.nes.nec.co.jp, afaerber@suse.de On 07/16/2013 10:06 AM, Stefan Hajnoczi wrote: > On Tue, Jul 09, 2013 at 03:30:07PM +0800, Qiao Nuohan wrote: >> +static int write_start_flat_header(int fd) >> +{ >> + char buf[MAX_SIZE_MDF_HEADER]; >> + MakedumpfileHeader mh; > > Why is buf[] necessary? You can write mh directly. > The size of header should be MAX_SIZE_MDF_HEADER not "sizeof(mh)". So the buf[] is used to fill the gap between mh and the first MakedumpfileDataHeader. -- Regards Qiao Nuohan