On 08/14/2018 07:10 PM, Paolo Bonzini wrote:
> On 14/08/2018 18:11, Thomas Huth wrote:
>> On 08/14/2018 06:03 PM, Paolo Bonzini wrote:
>>> On 14/08/2018 18:01, Thomas Huth wrote:
>>>> On 08/14/2018 05:57 PM, Paolo Bonzini wrote:
>>>>> On 14/08/2018 17:43, Thomas Huth wrote:
>>>>>> The machines which emulate an embedded system often always create a NIC
>>>>>> (since it is hard-wired on the board, not optional). But since there is
>>>>>> no back-end on the host side with "-nodefaults", the net_check_clients()
>>>>>> function complains in this case.
>>>>>
>>>>> [...] is the message unnecessary even in normal operation?
>>>>
>>>> I think it is still needed, since you could also screw up your command
>>>> line parameters after specifying -nodefaults (e.g. "-nodefaults -net
>>>> nic" without giving an additional "-net user" or something similar).
>>>
>>> True.  Though it cannot happen with -nic, so another possibility is to
>>> give it only if -net was used?
>>
>> Sorry, I don't quite get you ... this is a generic check in vl.c, how
>> should this code know whether the NICs have been specified with -nic or
>> -net?
> 
>       case QEMU_OPTION_net:
>           had_net = true;
>           ...
> 
>       if (!default_net && had_net) {
>           net_check_clients();
>       }

Looking at net_check_clients(), I think we're also checking -netdev
devices there, so we likely should call net_check_clients()
independently of whether -net has been specified by the user or not... I
think I'll best keep the patch in its current shape.

 Thomas

Reply via email to