mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net
So far virtio-net-device can't expose host features to guest while using virtio-mmio because it doesn't set DEFINE_VIRTIO_NET_FEATURES on backend or transport. So the performance is low. The host features belong to the backend while virtio-net-pci, virtio-net-s390 and virtio-net-ccw set the DEFINE_VIRTIO_NET_FEATURES on transports. But they already have the ability to forward property accesses to the backend child. So if we move the host features to backends, it doesn't break the backwards compatibility for them and make host features work while using virtio-mmio. Here we move DEFINE_VIRTIO_NET_FEATURES to the backend virtio-net. The transports just sync the host features from backend. Meanwhile move virtio_net_set_config_size to virtio-net to make sure the config size is correct and don't expose it. Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
51f7cb974b
commit
da3e8a2349
5 changed files with 7 additions and 8 deletions
|
@ -145,7 +145,6 @@ static void s390_virtio_net_realize(VirtIOS390Device *s390_dev, Error **errp)
|
|||
DeviceState *vdev = DEVICE(&dev->vdev);
|
||||
Error *err = NULL;
|
||||
|
||||
virtio_net_set_config_size(&dev->vdev, s390_dev->host_features);
|
||||
virtio_net_set_netclient_name(&dev->vdev, qdev->id,
|
||||
object_get_typename(OBJECT(qdev)));
|
||||
qdev_set_parent_bus(vdev, BUS(&s390_dev->bus));
|
||||
|
@ -508,7 +507,6 @@ static unsigned virtio_s390_get_features(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(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue