From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj6uR-0006Sx-KY for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:06:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj6uO-00045h-4V for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:06:19 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:38551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj6uN-00045O-W2 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:06:16 -0400 Received: by igbhj9 with SMTP id hj9so12771948igb.1 for ; Fri, 17 Apr 2015 07:06:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1429272826-4145-4-git-send-email-shannon.zhao@linaro.org> References: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> <1429272826-4145-4-git-send-email-shannon.zhao@linaro.org> From: Peter Maydell Date: Fri, 17 Apr 2015 15:05:55 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 3/4] hw/net/virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: "Michael S. Tsirkin" , "Huangpeng (Peter)" , QEMU Developers , Shannon Zhao , Paolo Bonzini , Christoffer Dall On 17 April 2015 at 13:13, Shannon Zhao wrote: > Move DEFINE_VIRTIO_NET_FEATURES to the backend virtio-net. > The transports just sync the host features from backend. > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > --- > hw/net/virtio-net.c | 4 ++++ > hw/s390x/s390-virtio-bus.c | 1 - > hw/s390x/virtio-ccw.c | 1 - > hw/virtio/virtio-pci.c | 1 - > include/hw/virtio/virtio-net.h | 1 + > 5 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 27adcc5..5d72e2d 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -446,6 +446,9 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features) > VirtIONet *n = VIRTIO_NET(vdev); > NetClientState *nc = qemu_get_queue(n->nic); > > + /* First sync all virtio-net possible supported features */ > + features |= n->host_features; > + > virtio_add_feature(&features, VIRTIO_NET_F_MAC); > > if (!peer_has_vnet_hdr(n)) { > @@ -1714,6 +1717,7 @@ static void virtio_net_instance_init(Object *obj) > } > > static Property virtio_net_properties[] = { > + DEFINE_VIRTIO_NET_FEATURES(VirtIONet, host_features), > DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf), > DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, > TX_TIMER_INTERVAL), > diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c > index 31fdf94..49c13e2 100644 > --- a/hw/s390x/s390-virtio-bus.c > +++ b/hw/s390x/s390-virtio-bus.c > @@ -517,7 +517,6 @@ static void virtio_s390_device_plugged(DeviceState *d) > > static Property s390_virtio_net_properties[] = { > DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), > - DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features), > DEFINE_PROP_END_OF_LIST(), > }; I'm confused. This seems to be the same "breaks backwards compatibility" implementation you suggested to me off-list and which I said wouldn't work. thanks -- PMM