From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTGi-0008RX-5k for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:43:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvTGb-00051D-QZ for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:43:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTGb-000511-J7 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:42:57 -0500 Message-ID: <50F6AED2.1080402@redhat.com> Date: Wed, 16 Jan 2013 14:44:50 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <20130116114521.GA20630@redhat.com> In-Reply-To: <20130116114521.GA20630@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-net: revert mac on reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Stefan Hajnoczi , Anthony Liguori , qemu-devel@nongnu.org, Paolo Bonzini On 01/16/13 12:45, Michael S. Tsirkin wrote: > Once guest overrides virtio net primary mac, > it retains the value set until qemu exit. > This is inconsistent with standard nic behaviour. > To fix, revert the mac to the original value on reset. > > Signed-off-by: Michael S. Tsirkin > --- > hw/virtio-net.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index 3bb01b1..4d80a25 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -199,6 +199,7 @@ static void virtio_net_reset(VirtIODevice *vdev) > n->mac_table.multi_overflow = 0; > n->mac_table.uni_overflow = 0; > memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN); > + memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac)); > memset(n->vlans, 0, MAX_VLAN >> 3); > } > Reviewed-by: Laszlo Ersek