From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvTML-0002cw-OM for qemu-devel@nongnu.org; Sun, 08 Nov 2015 12:02:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvTMH-0007MK-P1 for qemu-devel@nongnu.org; Sun, 08 Nov 2015 12:02:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvTMH-0007M7-Jw for qemu-devel@nongnu.org; Sun, 08 Nov 2015 12:02:25 -0500 Date: Sun, 8 Nov 2015 19:02:21 +0200 From: "Michael S. Tsirkin" Message-ID: <20151108185953-mutt-send-email-mst@redhat.com> References: <1445963383-8345-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1445963383-8345-1-git-send-email-marcandre.lureau@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] exec: silence hugetlbfs warning under qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com Cc: Peter Maydell , qemu-devel@nongnu.org On Tue, Oct 27, 2015 at 05:29:43PM +0100, marcandre.lureau@redhat.com wro= te: > From: Marc-Andr=E9 Lureau >=20 > vhost-user-test prints a warning. A test should not need to run on > hugetlbfs, let's silence the warning under qtest. Unfortunately, the > condition can't check on qtest_enabled() or qtest_driver() since they > are initialized later. >=20 > Signed-off-by: Marc-Andr=E9 Lureau Any idea what's the best way to address this? Is poking at environment like this appropriate? Maybe a command line flag to silence the warning? > --- > exec.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/exec.c b/exec.c > index 8af2570..d9c231d 100644 > --- a/exec.c > +++ b/exec.c > @@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Err= or **errp) > return 0; > } > =20 > - if (fs.f_type !=3D HUGETLBFS_MAGIC) > + if (fs.f_type !=3D HUGETLBFS_MAGIC && !getenv("QTEST_QEMU_BINARY")= ) { > fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path); > + } > =20 > return fs.f_bsize; > } > --=20 > 2.4.3