From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyRfy-0005N4-KA for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:51:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyRfu-0005NC-Gv for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:51:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyRfu-0005MW-0T for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:50:58 -0500 Date: Mon, 16 Nov 2015 23:50:54 +0200 From: "Michael S. Tsirkin" Message-ID: <20151116235029-mutt-send-email-mst@redhat.com> References: <1447694618-17177-1-git-send-email-marcandre.lureau@redhat.com> <1447694618-17177-3-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: <1447694618-17177-3-git-send-email-marcandre.lureau@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] 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, pbonzini@redhat.com On Mon, Nov 16, 2015 at 06:23:38PM +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. Moving configure_accelerator() earlier is > problematic, as the memory regions aren't yet fully set up and > vhost-user-test fails. >=20 > Signed-off-by: Marc-Andr=E9 Lureau > --- Peter, Paolo, any comments on this one? > exec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/exec.c b/exec.c > index b09f18b..3edc582 100644 > --- a/exec.c > +++ b/exec.c > @@ -1184,6 +1184,7 @@ void qemu_mutex_unlock_ramlist(void) > static long gethugepagesize(const char *path, Error **errp) > { > struct statfs fs; > + const char *p; > int ret; > =20 > do { > @@ -1196,8 +1197,11 @@ static long gethugepagesize(const char *path, Er= ror **errp) > return 0; > } > =20 > - if (fs.f_type !=3D HUGETLBFS_MAGIC) > + p =3D qemu_opt_get(qemu_get_machine_opts(), "accel"); > + if (g_strcmp0(p, "qtest") && > + fs.f_type !=3D HUGETLBFS_MAGIC) { > fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path); > + } > =20 > return fs.f_bsize; > } > --=20 > 2.5.0