Received: from eggs.gnu.org ([2001:4830:134:3::10]:49198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvhDo-0006Gv-D7 for qemu-devel@nongnu.org; Mon, 09 Nov 2015 02:50:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvhDj-0007zU-ED for qemu-devel@nongnu.org; Mon, 09 Nov 2015 02:50:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvhDj-0007zQ-8S for qemu-devel@nongnu.org; Mon, 09 Nov 2015 02:50:31 -0500 From: Markus Armbruster References: <1445963383-8345-1-git-send-email-marcandre.lureau@redhat.com> <20151108185953-mutt-send-email-mst@redhat.com> Date: Mon, 09 Nov 2015 08:50:28 +0100 In-Reply-To: <20151108185953-mutt-send-email-mst@redhat.com> (Michael S. Tsirkin's message of "Sun, 8 Nov 2015 19:02:21 +0200") Message-ID: <87oaf3pq63.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: "Michael S. Tsirkin" Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org, Peter Maydell "Michael S. Tsirkin" writes: > On Tue, Oct 27, 2015 at 05:29:43PM +0100, marcandre.lureau@redhat.com wro= te: >> From: Marc-Andr=C3=A9 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=C3=A9 Lureau > > Any idea what's the best way to address this? Can we reorder things so that qtest_enabled() can be used? > Is poking at environment like this appropriate? I'm afraid it isn't. QTEST_QEMU_BINARY can be in the environment even when you're not running under qtest. > Maybe a command line flag to silence the warning? There's -qtest and -qtest-log. I guess keying on those would be less unclean than QTEST_QEMU_BINARY. >> --- >> 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, Erro= r **errp) >> return 0; >> } >>=20=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=20 >> return fs.f_bsize; >> } >> --=20 >> 2.4.3