migrate: Update ram_block_discard_range for shared
commitdb144f7000327a98a7ed0b32f1fc8615ad4ae740
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 12 Mar 2018 17:20:56 +0000 (12 17:20 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 20 Mar 2018 03:03:26 +0000 (20 05:03 +0200)
treeb9b6f1440c3b925f32652db6cc0b733b106bd894
parent9578f8cc3e8bd71de8e3f543dc7b95644d64824e
migrate: Update ram_block_discard_range for shared

The choice of call to discard a block is getting more complicated
for other cases.   We use fallocate PUNCH_HOLE in any file cases;
it works for both hugepage and for tmpfs.
We use the DONTNEED for non-hugepage cases either where they're
anonymous or where they're private.

Care should be taken when trying other backing files.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
exec.c
trace-events