From: Thomas Huth <thuth@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] net: Silence 'has no peer' messages in testing mode
Date: Fri, 4 May 2018 16:55:57 +0200 [thread overview]
Message-ID: <54f1bb8c-c61e-557a-952d-92ba1297e818@redhat.com> (raw)
In-Reply-To: <87k1slot93.fsf@dusky.pond.sub.org>
On 03.05.2018 13:47, Markus Armbruster wrote:
> Thomas Huth <thuth@redhat.com> writes:
>
>> When running qtests with -nodefaults, we are not interested in
>> these 'XYZ has no peer' messages.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> 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
next prev parent reply other threads:[~2018-05-04 14:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 5:50 [Qemu-devel] [PATCH] net: Silence 'has no peer' messages in testing mode Thomas Huth
2018-05-03 11:47 ` Markus Armbruster
2018-05-04 14:55 ` Thomas Huth [this message]
2018-05-07 7:14 ` Markus Armbruster
2018-05-08 13:19 ` Thomas Huth
2018-05-09 6:18 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54f1bb8c-c61e-557a-952d-92ba1297e818@redhat.com \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).