Skip to content

Commit fa2fada

Browse files
committed
Disable offloading for krunkit
Future krunkit provides unixgram socket option supporting offloading argument to enable of disable offloading. This is a quick and dirty change to test the new option. To complete this change we need to remove the "auto" feature for offloading since we never want to enable it automatically. It can be nice to keep it for testing krunkit with offloading, since it does increase performance for vm-to-host traffic. Requires krunkit PR: containers/krunkit#63 And installing local libkrun-efi from main.
1 parent a280911 commit fa2fada

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ CONNECTION_AUTO = {
2222

2323
VMNET_OFFLOAD_AUTO = {
2424
"vfkit": "off",
25-
# libkrun enables offloading features by default, so we must enable vmnet
26-
# offloading. See https://github.com/containers/libkrun/issues/264
27-
"krunkit": "on",
25+
"krunkit": "off",
2826
"qemu": "off",
2927
}
3028

vmnet/vm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(self, args, mac_address, fd=None, socket=None, client=None):
4242
self.memory = args.memory
4343
self.distro = args.distro
4444
self.serial = store.vm_path(self.vm_name, "serial.log")
45+
self.vmnet_offload = args.vmnet_offload
4546

4647
# Running info
4748
self.disk = None
@@ -174,14 +175,15 @@ def krunkit_command(self):
174175
raise ValueError("fd connection not supported for krunkit driver")
175176
if self.socket is None:
176177
raise ValueError("socket connection required")
178+
offloading = "true" if self.vment_offload == "on" else "false"
177179
return [
178180
self.driver_command or "krunkit",
179181
f"--memory={self.memory}",
180182
f"--cpus={self.cpus}",
181183
f"--restful-uri=none://",
182184
f"--device=virtio-blk,path={self.disk['image']}",
183185
f"--device=virtio-blk,path={self.cidata}",
184-
f"--device=virtio-net,unixSocketPath={self.socket},mac={self.mac_address}",
186+
f"--device=virtio-net,unixgram={self.socket},mac={self.mac_address},offloading={offloading}",
185187
f"--device=virtio-serial,logFilePath={self.serial}",
186188
"--krun-log-level=3",
187189
]

0 commit comments

Comments
 (0)