From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNSM3-0000xO-HI for qemu-devel@nongnu.org; Fri, 20 May 2011 12:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNSM2-0004rw-LS for qemu-devel@nongnu.org; Fri, 20 May 2011 12:15:11 -0400 Received: from thoth.sbs.de ([192.35.17.2]:24859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNSM2-0004rq-1b for qemu-devel@nongnu.org; Fri, 20 May 2011 12:15:10 -0400 Message-ID: <4DD6938B.9080202@siemens.com> Date: Fri, 20 May 2011 18:15:07 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1305906601-25324-1-git-send-email-peter.maydell@linaro.org> <4DD68F06.7030204@siemens.com> <4DD691DC.7080109@siemens.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] net: reimplement -net nic diagnostic fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "patches@linaro.org" , "qemu-devel@nongnu.org" , Markus Armbruster On 2011-05-20 18:12, Peter Maydell wrote: > On 20 May 2011 17:07, Jan Kiszka wrote: >> On 2011-05-20 18:04, Peter Maydell wrote: >>> I think that avoiding MAC address clashes should be done by >>> having net_init_nic() call qemu_macaddr_default_if_unset() >> >> You mean qemu_new_nic? Otherwise it wouldn't help. Will have a look to >> move that over. > > No, I mean net_init_nic(). At the moment there are two bits of > code which generate a fresh MAC address: > 1. qemu_macaddr_default_if_unset() -- init routines for qdev network > devices call this > 2. net_init_nic() -- devices created via -net nic get their MAC > address assigned here; if the underlying device is qdev then > by the time the qdev init routine is called the macaddr is > already set so it isn't overridden > > So if the code in 2. calls qemu_macaddr_default_if_unset instead then > we only have one function with a static variable which doles out > autogenerated MAC addresses. Ah, I see. I thought qdev would always assign the same MAC. Then it's fine. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux