diff options
author | David L Stevens <dlstevens@us.ibm.com> | 2010-03-31 21:20:31 +0300 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-04-13 23:58:20 +0200 |
commit | dc14a397812b91dd0d48b03d1b8f66a251542369 (patch) | |
tree | 8875c6d353c1851d7140a391e7f4616da2bd406f | |
parent | 5ba9e9522cf572715ca1966b292f64fb78342e22 (diff) | |
download | qemu-dc14a397812b91dd0d48b03d1b8f66a251542369.tar.gz qemu-dc14a397812b91dd0d48b03d1b8f66a251542369.tar.bz2 qemu-dc14a397812b91dd0d48b03d1b8f66a251542369.zip |
vhost: fix features ack
vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | hw/virtio-net.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 970ba06275..acb3cec7cb 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -219,6 +219,14 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint32_t features) (features >> VIRTIO_NET_F_GUEST_ECN) & 1, (features >> VIRTIO_NET_F_GUEST_UFO) & 1); } + if (!n->nic->nc.peer || + n->nic->nc.peer->info->type != NET_CLIENT_TYPE_TAP) { + return; + } + if (!tap_get_vhost_net(n->nic->nc.peer)) { + return; + } + return vhost_net_ack_features(tap_get_vhost_net(n->nic->nc.peer), features); } static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd, |