From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36550 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvYSH-00026k-Al for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvYQI-0003NA-S8 for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:31:59 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:61629) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvYQI-0003N3-Jz for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:31:58 -0400 Received: by qyk34 with SMTP id 34so2971164qyk.4 for ; Tue, 14 Sep 2010 09:31:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1284413185-2988-1-git-send-email-andreas.faerber@web.de> References: <1284413185-2988-1-git-send-email-andreas.faerber@web.de> From: Blue Swirl Date: Tue, 14 Sep 2010 16:31:37 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [RFC v4] Introduce qemu_madvise() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: qemu-devel@nongnu.org, Alexander Graf On Mon, Sep 13, 2010 at 9:26 PM, Andreas F=C3=A4rber wrote: > From: Andreas F=C3=A4rber > > vl.c has a Sun-specific hack to supply a prototype for madvise(), > but the call site has apparently moved to arch_init.c. > > Haiku doesn't implement madvise() in favor of posix_madvise(). > OpenBSD and Solaris 10 don't implement posix_madvise() but madvise(). > > Check for madvise() and posix_madvise() in configure and supply qemu_madv= ise() > as wrapper. Prefer madvise() over posix_madvise() due to flag availabilit= y. > Convert all callers to use qemu_madvise() and QEMU_MADV_*. > > Note that on Solaris the warning is fixed by moving the madvise() prototy= pe, > not by qemu_madvise() itself. It will help with future porting though. > > v3 -> v4: > * Eliminate #ifdefs at qemu_advise() call sites. Requested by Blue Swirl. > =C2=A0This will currently break the check in kvm-all.c by calling madvise= () with > =C2=A0a supported flag, which will not fail. Ideas/patches welcome. Your original switch with synthetic (1<<0, 1<<1 etc) values for QEMU_MADV_* for all hosts (never reusing MADV_* defines).