Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the vhost backend for the virtio-net interfaces in the KVM hypervisor #4438

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/pillar/hypervisor/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ const qemuNetTemplate = `
br = "{{.Bridge}}"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
{{- if eq .Driver "virtio-net-pci" }}
vhost = "on"
{{- end}}

[device "net{{.NetID}}"]
driver = "{{.Driver}}"
Expand Down
14 changes: 14 additions & 0 deletions pkg/pillar/hypervisor/kvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -346,6 +347,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -610,6 +612,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -632,6 +635,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -863,6 +867,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -885,6 +890,7 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -1352,6 +1358,7 @@ func domConfigArm64() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -1374,6 +1381,7 @@ func domConfigArm64() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -1649,6 +1657,7 @@ func domConfigAmd64FML() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -1671,6 +1680,7 @@ func domConfigAmd64FML() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -2234,6 +2244,7 @@ func domConfigAmd64() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -2256,6 +2267,7 @@ func domConfigAmd64() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down Expand Up @@ -2520,6 +2532,7 @@ func domConfigContainerVNC() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net0"]
driver = "virtio-net-pci"
Expand All @@ -2542,6 +2555,7 @@ func domConfigContainerVNC() string {
br = "bn0"
script = "/etc/xen/scripts/qemu-ifup"
downscript = "no"
vhost = "on"

[device "net1"]
driver = "virtio-net-pci"
Expand Down
Loading