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
This commit is contained in:
Aurelien Jarno 2013-04-28 17:06:33 +02:00 committed by Ben Gras
parent b538531449
commit f0c391e09b

View file

@ -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 }
};