"Dr. David Alan Gilbert (git)" <dgilb...@redhat.com> wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > Where postcopy is preceeded by a period of precopy, the destination will > have received pages that may have been dirtied on the source after the > page was sent. The destination must throw these pages away before > starting it's CPUs. > > Calculate list of sent & dirty pages > Provide helpers on the destination side to discard these. > > Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com>
Reviewed-by: Juan Quintela <quint...@redhat.com> But please, send a fix for: > return ret; > } > > +/** > + * postcopy_ram_discard_range: Discard a range of memory. > + * We can assume that if we've been called postcopy_ram_hosttest returned > true. > + * > + * @mis: Current incoming migration state. > + * @start, @length: range of memory to discard. > + * > + * returns: 0 on success. > + */ > +int postcopy_ram_discard_range(MigrationIncomingState *mis, uint8_t *start, > + size_t length) > +{ > + trace_postcopy_ram_discard_range(start, length); > + if (madvise(start, length, MADV_DONTNEED)) { qemu_madvise(start, length, QEMU_MADV_DONTNEED)