summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Libvirt.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs
index de08fcdb..aec9f3c8 100644
--- a/src/Propellor/Property/Libvirt.hs
+++ b/src/Propellor/Property/Libvirt.hs
@@ -140,6 +140,9 @@ defined imageType (MiBMemory mem) (NumVCPUs cpus) auto h =
-- ==== utility functions ====
+-- The --os-variant property is optional, per virt-install(1), so return Nothing
+-- if there isn't a known correct value. The VM will still be defined. Pass
+-- the value if we can, though, to optimise the generated XML for the host's OS
osVariant :: Host -> Maybe String
osVariant h = hostSystem h >>= \s -> case s of
System (Debian _ (Stable "jessie")) _ -> Just "debian8"