exec: silence hugetlbfs warning under qtest
PATCH 1/1 exec: silence hugetlbfs warning under qtest
From: Marc-André Lureau <[email protected]>
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.
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
exec.c +2 -1
@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }
Signature · 1 line
2.4.3
Quoted 8 lines · On Tue, Oct 27, 2015 at 05:29:43PM +0100, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
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()orqtest_driver()since they are initialized later.Signed-off-by Marc-André Lureau <[email protected]>
Let's move the warning to somewhere later then.
Quoted 21 lines
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)exec.c +2
-1@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }Signature · 1 line
2.4.3
Quoted 8 lines · On Tue, Oct 27, 2015 at 05:29:43PM +0100, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
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()orqtest_driver()since they are initialized later.Signed-off-by Marc-André Lureau <[email protected]>
I guess we need a command line option to suppress the warning. Seems a lot of work for very little benefit, but that's the best I could come up with.
Quoted 21 lines
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)exec.c +2
-1@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }Signature · 1 line
2.4.3
Quoted 8 lines · On Tue, Oct 27, 2015 at 05:29:43PM +0100, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
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()orqtest_driver()since they are initialized later.Signed-off-by Marc-André Lureau <[email protected]>
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?
Quoted 21 lines
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)exec.c +2
-1@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }Signature · 1 line
2.4.3
Quoted 11 lines · Michael S. Tsirkin
Quoted 8 lines · On Tue, Oct 27, 2015 at 05:29:43PM +0100, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
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()orqtest_driver()since they are initialized later.Signed-off-by Marc-André Lureau <[email protected]>Any idea what's the best way to address this?
Can we reorder things so that qtest_enabled() can be used?
Quoted 1 line
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.
Quoted 1 line
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.
Quoted 21 lines
Quoted 21 lines
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)exec.c +2
-1@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }Signature · 1 line
2.4.3
Quoted 8 lines · On Tue, Oct 27, 2015 at 05:29:43PM +0100, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
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()orqtest_driver()since they are initialized later.Signed-off-by Marc-André Lureau <[email protected]>
OK so far this is the best we could come up with, so I'll queue this up for after 2.5 unless someone objects.
Quoted 21 lines
--- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)exec.c +2
-1@@ -1194,8 +1194,9 @@ static long gethugepagesize(const char *path, Error **errp)return 0 ; } -if (fs.f_type !=HUGETLBFS_MAGIC ) +if (fs.f_type !=HUGETLBFS_MAGIC && !getenv ("QTEST_QEMU_BINARY" )) {fprintf (stderr,"Warning: path not on HugeTLBFS: %s\n" , path); + }return fs.f_bsize; }Signature · 1 line
2.4.3