From patchwork Wed Oct 28 14:07:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 37113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CA47AB7BE9 for ; Thu, 29 Oct 2009 01:35:07 +1100 (EST) Received: from localhost ([127.0.0.1]:53429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N39c9-0003p2-6x for incoming@patchwork.ozlabs.org; Wed, 28 Oct 2009 10:35:05 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N39DO-0004gX-LP for qemu-devel@nongnu.org; Wed, 28 Oct 2009 10:09:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N39DI-0004dL-Tw for qemu-devel@nongnu.org; Wed, 28 Oct 2009 10:09:30 -0400 Received: from [199.232.76.173] (port=42735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N39DI-0004dC-IC for qemu-devel@nongnu.org; Wed, 28 Oct 2009 10:09:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9806) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N39DH-000611-2N for qemu-devel@nongnu.org; Wed, 28 Oct 2009 10:09:24 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9SE9Kpg023623 for ; Wed, 28 Oct 2009 10:09:21 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9SE9JG9009088; Wed, 28 Oct 2009 10:09:19 -0400 From: Mark McLoughlin To: Gerd Hoffmann In-Reply-To: <1256131543-28416-15-git-send-email-kraxel@redhat.com> References: <1256131543-28416-1-git-send-email-kraxel@redhat.com> <1256131543-28416-15-git-send-email-kraxel@redhat.com> Date: Wed, 28 Oct 2009 14:07:23 +0000 Message-Id: <1256738843.5105.37.camel@blaa> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] virtio-net: fix macaddr config regression X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This commit: commit 97b15621 virtio: use qdev properties for configuration. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori makes a guest using virtio-net see an empty macaddr because we never copy the macaddr into the location that virtio_net_get_config() uses. Signed-off-by: Mark McLoughlin --- hw/virtio-net.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 93294af..4b09a93 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -837,6 +837,7 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf) n->tx_vq = virtio_add_queue(&n->vdev, 256, virtio_net_handle_tx); n->ctrl_vq = virtio_add_queue(&n->vdev, 64, virtio_net_handle_ctrl); qemu_macaddr_default_if_unset(&conf->macaddr); + memcpy(&n->mac[0], &conf->macaddr, sizeof(n->mac)); n->status = VIRTIO_NET_S_LINK_UP; n->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, conf->vlan, conf->peer, dev->info->name, dev->id,