From f0c391e09b3a11500988fdbed36a49fe6d61ac64 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 28 Apr 2013 17:06:33 +0200 Subject: [PATCH] virtio-net: acknowledge used features According to the virtio specifications, the host present the supported features to the guest, and the guest should answer woth the features it supports. This allows the host to disable support for features that the guest is not going to use. Minix tells to the host it doesn't support any extended features, while it uses at least VIRTIO_NET_F_MAC and VIRTIO_NET_F_CTRL_VQ. For the latter it seems it only allocate the queue while not using it later. However starting with QEMU 1.4.0, with multiqueue support added, the control queue is not allocated on the host side if the guest doesn't tell it supports this feature. This cause virtio-net to crash on the Minix side. This patch fixes that by correctly telling the features that are used by the Minix guest for more than printing a debug message. This fixes virtio-net on QEMU 1.4.x. Change-Id: I8bbf757c09d24e0f5fe5835531a1c9203b714bd7 --- drivers/virtio_net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio_net/virtio_net.c b/drivers/virtio_net/virtio_net.c index 9f1749532..0fad9c6ef 100644 --- a/drivers/virtio_net/virtio_net.c +++ b/drivers/virtio_net/virtio_net.c @@ -112,9 +112,9 @@ static void sef_cb_signal_handler(int signo); /* TODO: Features are pretty much ignored */ struct virtio_feature netf[] = { { "partial csum", VIRTIO_NET_F_CSUM, 0, 0 }, - { "given mac", VIRTIO_NET_F_MAC, 0, 0 }, + { "given mac", VIRTIO_NET_F_MAC, 0, 1 }, { "status ", VIRTIO_NET_F_STATUS, 0, 0 }, - { "control channel", VIRTIO_NET_F_CTRL_VQ, 0, 0 }, + { "control channel", VIRTIO_NET_F_CTRL_VQ, 0, 1 }, { "control channel rx", VIRTIO_NET_F_CTRL_RX, 0, 0 } }; -- 2.44.0