From be6065276a0bb80fc70916a8b212dc36ffeb7656 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 9 Nov 2018 16:53:30 -0700 Subject: kvmDefined -> defined The VM could be raw QEMU without KVM, and we might later extend the property to be able to Xen domains too. --- src/Propellor/Property/Libvirt.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs index 2e358486..82e7e1a5 100644 --- a/src/Propellor/Property/Libvirt.hs +++ b/src/Propellor/Property/Libvirt.hs @@ -7,7 +7,7 @@ module Propellor.Property.Libvirt ( DiskImageType(..), installed, defaultNetworkAutostarted, - kvmDefined, + defined, ) where import Propellor.Base @@ -61,7 +61,7 @@ defaultNetworkAutostarted = check (not <$> doesFileExist autostartFile) -- > & Libvirt.defaultNetworkAutostarted -- > `onChange` (cmdProperty "virsh" ["net-start", "default"] -- > `assume` MadeChange) --- > & Libvirt.kvmDefined Libvirt.Raw +-- > & Libvirt.defined Libvirt.Raw -- > (Libvirt.MiBMemory 2048) (Libvirt.NumVCPUs 2) -- > Libvirt.NoAutoStart subbox -- > @@ -80,15 +80,15 @@ defaultNetworkAutostarted = check (not <$> doesFileExist autostartFile) -- > (Just (Network.Gateway (IPv4 "192.168.122.1"))) -- > `requires` Network.cleanInterfacesFile -- > & Hostname.sane -kvmDefined +defined :: DiskImageType -> MiBMemory -> NumVCPUs -> AutoStart -> Host -> Property (HasInfo + DebianLike) -kvmDefined imageType (MiBMemory mem) (NumVCPUs cpus) auto h = - (built `before` nuked `before` defined `before` started) +defined imageType (MiBMemory mem) (NumVCPUs cpus) auto h = + (built `before` nuked `before` xmlDefined `before` started) `requires` installed where built :: Property (HasInfo + DebianLike) @@ -101,8 +101,8 @@ kvmDefined imageType (MiBMemory mem) (NumVCPUs cpus) auto h = liftIO $ removeChroot (imageLoc <.> "chroot") liftIO $ nukeFile (imageLoc <.> "parttable") return MadeChange) - defined :: Property UnixLike - defined = check (not <$> doesFileExist conf) + xmlDefined :: Property UnixLike + xmlDefined = check (not <$> doesFileExist conf) (scriptProperty [ "virt-install -n " ++ hostName h ++ osTypeArg ++ osVariantArg -- cgit v1.2.3