qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] exec: silence hugetlbfs warning under qtest


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] exec: silence hugetlbfs warning under qtest
Date: Mon, 09 Nov 2015 08:50:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Michael S. Tsirkin" <address@hidden> writes:

> On Tue, Oct 27, 2015 at 05:29:43PM +0100, address@hidden wrote:
>> From: Marc-André Lureau <address@hidden>
>> 
>> 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.
>> 
>> Signed-off-by: Marc-André Lureau <address@hidden>
>
> 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(-)
>> 
>> 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, 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;
>>  }
>> -- 
>> 2.4.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]