From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Tue, 12 Jan 2010 20:50:17 +0200 From: "Michael S. Tsirkin" Message-ID: <20100112185017.GA3202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] virtio-net: mac property is mandatory List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori , Gerd Hoffmann 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), \ -- 1.6.6.rc1.43.gf55cc