Skip to contentSkip to conversation

Fixes for kvmtool virtio-net part

PATCH Superseded Fan Du 1 participant 3 messages Jul 21, 2015 KVM

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Fan Du

author
#0 lore raw

cover Fixes for kvmtool virtio-net part

This changset provide some fix and small enhancement for kvm tool when I play it for the firt time.

Changelog:
v2:
- Rebase with Will kvmtool.git tree[1]
- Drop patch2 from v1, as commit f83dc816a9c7 has already fix it

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git

Fan Du (2):
kvmtool: Introduce downscript option for virtio-net
kvmtool: Restrict virtio queue number to 1 when vhost on

 include/kvm/virtio-net.h |  1 +
 virtio/net.c             | 54 ++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 44 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/2 kvmtool: Introduce downscript option for virtio-net

To detach tap device automatically from bridge when exiting, just like what the reverse of "script" does.

---
 include/kvm/virtio-net.h |  1 +
 virtio/net.c             | 50 +++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 40 insertions(+), 11 deletions(-)
include/kvm/virtio-net.h +1 -0
index f435cc3..d136a09 100644
@@ -9,6 +9,7 @@ struct virtio_net_params {
 	const char *guest_ip;
 	const char *host_ip;
 	const char *script;
+	const char *downscript;
 	const char *trans;
 	const char *tapif;
 	char guest_mac[6];
virtio/net.c +39 -11

74 lines not on this page · raw message

Signature · 1 line
1.8.3.1
author
#2 lore raw

PATCH 2/2 kvmtool: Restrict virtio queue number to 1 when vhost on

In reply to Fan Du

vhost kernel driver does not support mutiple queue yet, Tweak queue number will fail with "--net mode=tap,vhost=1,mq=2" as below when lkvm trying to set ring kick fd for queue 2:

VHOST_SET_VRING_KICK failed: No buffer space available

Error on this scenario, and overide with the default one queue configuration.

---
 virtio/net.c | 4 ++++
 1 file changed, 4 insertions(+)
virtio/net.c +4 -0
index 55dd9d9..78199b9 100644
@@ -731,6 +731,10 @@ static int set_net_param(struct kvm *kvm, struct virtio_net_params *p,
 		p->mq = atoi(val);
 	} else
 		die("Unknown network parameter %s", param);
+	if (p->vhost && p->mq > 1) {
+		p->mq = 1;
+		pr_err("vhost does not support mq yet, overide mq to 1.");
+	}
 
 	return 0;
 }
Signature · 1 line
1.8.3.1