On 07.05.2018 09:14, Markus Armbruster wrote: [...] > Two (possibly confused) questions: > > 1. The user can add nics without convenience options: > > $ upstream-qemu -display none -nodefaults -device e1000 > upstream-qemu: warning: nic e1000.0 has no peer > > Shouldn't we silence the warning then, too?
No, since that is certainly a mis-configuration in that case. Why would a user want to add a NIC without host backend? > 2. We already have code to silence the warning: > > /* Don't warn about the default network setup that you get if > * no command line -net or -netdev options are specified. There > * are two cases that we would otherwise complain about: > * (1) board doesn't support a NIC but the implicit "-net nic" > * requested one > * (2) CONFIG_SLIRP not set, in which case the implicit "-net nic" > * sets up a nic that isn't connected to anything. > */ > if (!default_net) { > net_check_clients(); > } > > Is it a good idea to split the logic between net_check_clients() and > its caller? Hmm, it's likely nicer to keep everything in one place. Since "default_net" is only available in vl.c, I think the checks should go there... so I'll rework my patch accordingly. Thomas