kvm tools: Make virtio net work on older kernels

Some old kernels do not support TUNSETVNETHDRSZ ioctl which modifies the virtio
net header size. The default header size should work, so let's go on if the
TUNSETVNETHDRSZ ioctl is not supported and just give a warnning.

Reported-by: John Floren <john@jfloren.net>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Asias He
2015-06-01 16:39:46 +01:00
committed by Will Deacon
parent 7c1ea8483f
commit 7ac71f4f54
-1
View File
@@ -348,7 +348,6 @@ static bool virtio_net__tap_init(const struct virtio_net_parameters *params)
hdr_len = sizeof(struct virtio_net_hdr);
if (ioctl(ndev.tap_fd, TUNSETVNETHDRSZ, &hdr_len) < 0) {
pr_warning("Config tap device TUNSETVNETHDRSZ error");
goto fail;
}
offload = TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | TUN_F_UFO;