libvirt: expose libvirt qemu configuration file

fixes #22823
This commit is contained in:
Tristan Helmich 2017-02-21 13:26:23 +01:00 committed by Robin Gloster
parent ba267839d1
commit 1d64f5f41b
No known key found for this signature in database
GPG Key ID: 5E4C836C632C2882

View File

@ -13,6 +13,9 @@ let
auth_unix_rw = "none"
${cfg.extraConfig}
'';
qemuConfigFile = pkgs.writeText "qemu.conf" ''
${cfg.qemuVerbatimConfig}
'';
in {
@ -48,6 +51,18 @@ in {
'';
};
virtualisation.libvirtd.qemuVerbatimConfig = mkOption {
type = types.lines;
default = ''
namespaces = []
'';
description = ''
Contents written to the qemu configuration file, qemu.conf.
Make sure to include a proper namespace configuration when
supplying custom configuration.
'';
};
virtualisation.libvirtd.extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
@ -119,6 +134,9 @@ in {
cp -npd ${pkgs.libvirt}/var/lib/$i /var/lib/$i
done
# Copy generated qemu config to libvirt directory
cp -f ${qemuConfigFile} /var/lib/libvirt/qemu.conf
# libvirtd puts the full path of the emulator binary in the machine
# config file. But this path can unfortunately be garbage collected
# while still being used by the virtual machine. So update the