To maintain consistency at all the places use qemu_madvise wrapper inplace of madvise call.
Signed-off-by: Pankaj Gupta <pagu...@redhat.com> --- block/qcow2-cache.c | 2 +- migration/postcopy-ram.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 1d25147..4991ca5 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -74,7 +74,7 @@ static void qcow2_cache_table_release(BlockDriverState *bs, Qcow2Cache *c, size_t offset = QEMU_ALIGN_UP((uintptr_t) t, align) - (uintptr_t) t; size_t length = QEMU_ALIGN_DOWN(mem_size - offset, align); if (length > 0) { - madvise((uint8_t *) t + offset, length, MADV_DONTNEED); + qemu_madvise((uint8_t *) t + offset, length, QEMU_MADV_DONTNEED); } #endif } diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index a40dddb..558fec1 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -213,7 +213,7 @@ 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)) { + if (qemu_madvise(start, length, QEMU_MADV_DONTNEED)) { error_report("%s MADV_DONTNEED: %s", __func__, strerror(errno)); return -1; } -- 2.7.4