qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] net: Silence 'has no peer' messages in testing


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH] net: Silence 'has no peer' messages in testing mode
Date: Fri, 4 May 2018 16:55:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 03.05.2018 13:47, Markus Armbruster wrote:
> Thomas Huth <address@hidden> writes:
> 
>> When running qtests with -nodefaults, we are not interested in
>> these 'XYZ has no peer' messages.
>>
>> Signed-off-by: Thomas Huth <address@hidden>
>> ---
>>  net/net.c | 13 +++++++------
>>  1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/net.c b/net/net.c
>> index 29f8398..58bf85e 100644
>> --- a/net/net.c
>> +++ b/net/net.c
>> @@ -1427,12 +1427,13 @@ void net_check_clients(void)
>>  
>>      net_hub_check_clients();
>>  
>> -    QTAILQ_FOREACH(nc, &net_clients, next) {
>> -        if (!nc->peer) {
>> -            warn_report("%s %s has no peer",
>> -                        nc->info->type == NET_CLIENT_DRIVER_NIC
>> -                        ? "nic" : "netdev",
>> -                        nc->name);
>> +    if (!qtest_enabled() || nd_table[0].used) {
> 
> I understand the !qtest_enabled part, but not the nd_table[0].used
> part.  Can you explain?

Sure: I want to silence the message in qtest mode with -nodefaults.
qtest mode enabled means qtest_enabled() returns true.
-nodefaults enabled means nd_table[0].used is set to false.
So silence the message if qtest_enabled() && !nd_table[0].used.
Negates to: Print the message if !qtest_enabled || nd_table[0].used.

>> +        QTAILQ_FOREACH(nc, &net_clients, next) {
>> +            if (!nc->peer) {
>> +                warn_report("%s %s has no peer",
>> +                            nc->info->type == NET_CLIENT_DRIVER_NIC
>> +                            ? "nic" : "netdev", nc->name);
>> +            }
>>          }
>>      }

 Thomas



reply via email to

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