From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNSJl-0007bS-Or for qemu-devel@nongnu.org; Fri, 20 May 2011 12:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNSJk-0004be-SX for qemu-devel@nongnu.org; Fri, 20 May 2011 12:12:49 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:50961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNSJk-0004bV-QK for qemu-devel@nongnu.org; Fri, 20 May 2011 12:12:48 -0400 Received: by qwj8 with SMTP id 8so2266721qwj.4 for ; Fri, 20 May 2011 09:12:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DD691DC.7080109@siemens.com> References: <1305906601-25324-1-git-send-email-peter.maydell@linaro.org> <4DD68F06.7030204@siemens.com> <4DD691DC.7080109@siemens.com> Date: Fri, 20 May 2011 17:12:47 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 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: Jan Kiszka Cc: "patches@linaro.org" , "qemu-devel@nongnu.org" , Markus Armbruster 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. -- PMM