Skip to content

Commit

Permalink
Use virtio disk driver from NixOS/nixops#9
Browse files Browse the repository at this point in the history
  • Loading branch information
onixie committed Jul 2, 2020
1 parent 92401ed commit 5084482
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions nix/libvirtd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ in
boot.loader.grub.device = "/dev/sda";
boot.loader.timeout = 0;

imports =
[ <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_blk" "virtio_net" ];
boot.kernelModules = [ "kvm-intel" ];

services.openssh.enable = true;
services.openssh.startWhenNeeded = false;
services.openssh.extraConfig = "UseDNS no";
Expand Down
4 changes: 2 additions & 2 deletions nixopsvirtd/backends/libvirtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ def _make_os(defn):
' <devices>',
' <emulator>{2}</emulator>',
' <disk type="file" device="disk">',
' <driver name="qemu" type="qcow2"/>',
' <driver name="qemu" type="qcow2" cache="none" io="native"/>',
' <source file="{3}"/>',
' <target dev="hda"/>',
' <target dev="hda" bus="virtio"/>',
' </disk>',
'\n'.join([self._make_iface(n) for n in defn.networks]),
' <graphics type="vnc" port="-1" autoport="yes"/>' if not defn.headless else "",
Expand Down

0 comments on commit 5084482

Please sign in to comment.