From: Pankaj Gupta <pagupta@redhat.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, quintela@redhat.com,
dgilbert@redhat.com
Subject: [Qemu-devel] [PATCH] block, migration: Use qemu_madvise inplace of madvise
Date: Fri, 17 Feb 2017 13:36:04 +0530 [thread overview]
Message-ID: <1487318764-29513-1-git-send-email-pagupta@redhat.com> (raw)
To maintain consistency at all the places use qemu_madvise wrapper
inplace of madvise call.
Signed-off-by: Pankaj Gupta <pagupta@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
next reply other threads:[~2017-02-17 8:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 8:06 Pankaj Gupta [this message]
2017-02-17 8:49 ` [Qemu-devel] [PATCH] block, migration: Use qemu_madvise inplace of madvise Kevin Wolf
2017-02-17 9:48 ` Dr. David Alan Gilbert
2017-02-17 10:06 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-02-17 11:30 ` Pankaj Gupta
2017-02-17 11:36 ` Dr. David Alan Gilbert
2017-02-17 12:30 ` Pankaj Gupta
2017-02-17 12:49 ` Alberto Garcia
2017-02-17 12:31 ` Alberto Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487318764-29513-1-git-send-email-pagupta@redhat.com \
--to=pagupta@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).