Skip to content

Commit a2987e8

Browse files
committed
firecracker: Set --enable-pci option by default when available
This enables the PCI virtio transport which is supposed to be faster than the MMIO one. Support for this flag is currently only availble in Nixpkgs unstable. I haven't been able to measure these perf improvements. However this is still what the Firecracker docs say to do, so I guess let's make it the default?
1 parent 1d05a3c commit a2987e8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/runners/firecracker.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ in {
8686
then throw "hotpluggedMem not implemented for Firecracker"
8787
else if credentialFiles != {}
8888
then throw "credentialFiles are not implemented for Firecracker"
89-
else lib.escapeShellArgs [
89+
else lib.escapeShellArgs ([
9090
"${pkgs.firecracker}/bin/firecracker"
9191
"--config-file" configFile
9292
"--api-sock" (
9393
if socket != null
9494
then socket
9595
else throw "Firecracker must be configured with an API socket (option microvm.socket)!"
9696
)
97-
];
97+
] ++ lib.optional microvmConfig.firecracker.enablePci "--enable-pci");
9898

9999
preStart = ''
100100
${preStart}

nixos-modules/microvm/options.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,12 @@ in
590590
description = "Custom CPU template passed to firecracker.";
591591
};
592592

593+
firecracker.enablePci = mkOption {
594+
type = types.bool;
595+
default = lib.versionAtLeast pkgs.firecracker.version "1.13.0";
596+
description = "Use PCI Virtio transport, improves performance.";
597+
};
598+
593599
prettyProcnames = mkOption {
594600
type = types.bool;
595601
default = true;

0 commit comments

Comments
 (0)