On Tue, Feb 16, 2016 at 01:39:36PM +0100, Andrew Jones wrote: > On Tue, Feb 16, 2016 at 03:50:58PM +0800, Peter Xu wrote: > > Here, total_size is the size in bytes to be dumped (raw data, which > > means before compression), while written_size are bytes handled (raw > > size too). > > > > Signed-off-by: Peter Xu <pet...@redhat.com> > > Reviewed-by: Fam Zheng <f...@redhat.com> > > --- > > dump.c | 32 ++++++++++++++++++++++++++++++++ > > include/sysemu/dump.h | 9 +++++++++ > > 2 files changed, 41 insertions(+) > > > > diff --git a/dump.c b/dump.c > > index 9210a72..ca2400d 100644 > > --- a/dump.c > > +++ b/dump.c > > @@ -331,6 +331,8 @@ static void write_data(DumpState *s, void *buf, int > > length, Error **errp) > > ret = fd_write_vmcore(buf, length, s); > > if (ret < 0) { > > error_setg(errp, "dump: failed to save memory"); > > + } else { > > + s->written_size += length; > > } > > } > > > > @@ -1324,6 +1326,7 @@ static void write_dump_pages(DumpState *s, Error > > **errp) > > goto out; > > } > > } > > + s->written_size += TARGET_PAGE_SIZE; > > Don't use TARGET_PAGE_SIZE, use s->dump_info.page_size, see 8161befd >
Will fix. Thanks! Peter