virtio-net: make VirtIOFeature usable for other virtio devices
commitba550851f5de642b8a1359e2c5c27cbb5a52ae61
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 21 Feb 2019 10:33:08 +0000 (21 11:33 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 22 Feb 2019 09:42:16 +0000 (22 09:42 +0000)
tree570cb2e6615053bf8b8491dc1b1c7149a9ed78a7
parent5c81161f804144b146607f890e84613a4cbad95c
virtio-net: make VirtIOFeature usable for other virtio devices

In order to use VirtIOFeature also in other virtio devices, we move
its declaration and the endof() macro (renamed in virtio_endof())
in virtio.h.
We add virtio_feature_get_config_size() function to iterate the array
of VirtIOFeature and to return the config size depending on the
features enabled. (as virtio_net_set_config_size() did)

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20190221103314.58500-5-sgarzare@redhat.com
Message-Id: <20190221103314.58500-5-sgarzare@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/virtio-net.c
hw/virtio/virtio.c
include/hw/virtio/virtio.h