From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNODn-0005mt-13 for qemu-devel@nongnu.org; Fri, 20 May 2011 07:50:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNODm-0003bo-1b for qemu-devel@nongnu.org; Fri, 20 May 2011 07:50:22 -0400 Received: from thoth.sbs.de ([192.35.17.2]:32259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNODl-0003bY-MK for qemu-devel@nongnu.org; Fri, 20 May 2011 07:50:21 -0400 Message-ID: <4DD65579.6090901@siemens.com> Date: Fri, 20 May 2011 13:50:17 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Regression "Warning: more nics requested than this machine supports" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Markus Armbruster , qemu-devel@nongnu.org On 2011-05-20 13:19, Peter Maydell wrote: > On 16 May 2011 17:58, Markus Armbruster wrote: >> $ qemu-system-x86_64 -nodefaults -enable-kvm -m 384 -vnc :0 -S -netdev user,id=net0 -device e1000,netdev=net0 >> Warning: more nics requested than this machine supports; some have been ignored >> (qemu) info network >> Devices not on any VLAN: >> net0: net=10.0.2.0, restricted=n peer=e1000.0 >> e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0 >> >> Culprit is >> net: Improve the warnings for dubious command line option combinations > >> Its count of requested NICs is blissfully unaware of -device. In my >> example, it comes up with nb_nics == 0 and seen_nics == 1. > > As far as I can determine, "-device e1000,netdev=0" doesn't go through > net_init_nic() and doesn't put an entry in the nd_table[] for the NIC. > This means it's broken, because a lot of board models look in nd_table[] > to determine whether the user requested a NIC and whether it's the right > type. So I think that in some ways this is just showing up an existing > problem with trying to instantiate a network card with -device. qemu_new_nic must call net_init_nic so that this works properly. Of course we need to avoid calling it multiple times when the adapter is still instantiated via the old -net or via board init code. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux