From patchwork Tue Jan 12 18:50:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 42740 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 278501007D2 for ; Wed, 13 Jan 2010 05:54:06 +1100 (EST) Received: from localhost ([127.0.0.1]:44881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUlsR-00076r-40 for incoming@patchwork.ozlabs.org; Tue, 12 Jan 2010 13:54:03 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUlrk-0006y2-7T for qemu-devel@nongnu.org; Tue, 12 Jan 2010 13:53:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUlrf-0006rK-7m for qemu-devel@nongnu.org; Tue, 12 Jan 2010 13:53:19 -0500 Received: from [199.232.76.173] (port=48145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUlre-0006r3-VN for qemu-devel@nongnu.org; Tue, 12 Jan 2010 13:53:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUlre-0006lu-Cy for qemu-devel@nongnu.org; Tue, 12 Jan 2010 13:53:14 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0CIrCVY016056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Jan 2010 13:53:12 -0500 Received: from redhat.com (dhcp-0-94.tlv.redhat.com [10.35.0.94]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o0CIrAhU017891; Tue, 12 Jan 2010 13:53:11 -0500 Date: Tue, 12 Jan 2010 20:50:17 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Anthony Liguori , Gerd Hoffmann Message-ID: <20100112185017.GA3202@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] virtio-net: mac property is mandatory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list 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 Mac feature bit isn't going to work as all network cards already have a 'mac' property to set the mac address. Remove it from mask and add in get_features. Reported-by: Gerd Hoffmann Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c | 2 ++ hw/virtio-net.h | 1 - 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index c2a389f..02d9180 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -151,6 +151,8 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features) { VirtIONet *n = to_virtio_net(vdev); + features |= (1 << VIRTIO_NET_F_MAC); + if (peer_has_vnet_hdr(n)) { tap_using_vnet_hdr(n->nic->nc.peer, 1); } else { diff --git a/hw/virtio-net.h b/hw/virtio-net.h index 9130d75..e55119b 100644 --- a/hw/virtio-net.h +++ b/hw/virtio-net.h @@ -157,7 +157,6 @@ struct virtio_net_ctrl_mac { DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \ DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \ DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM, true), \ - DEFINE_PROP_BIT("mac", _state, _field, VIRTIO_NET_F_MAC, true), \ DEFINE_PROP_BIT("gso", _state, _field, VIRTIO_NET_F_GSO, true), \ DEFINE_PROP_BIT("guest_tso4", _state, _field, VIRTIO_NET_F_GUEST_TSO4, true), \ DEFINE_PROP_BIT("guest_tso6", _state, _field, VIRTIO_NET_F_GUEST_TSO6, true), \