hen 0.0.2 → 0.0.3
raw patch · 3 files changed
+59/−7 lines, 3 filesdep +QuickCheckdep +hendep +test-frameworkdep ~bitsetdep ~containersdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependencies added: QuickCheck, hen, test-framework, test-framework-quickcheck2
Dependency ranges changed: bitset, containers, mtl
API changes (from Hackage documentation)
Files
- hen.cabal +24/−4
- src/System/Xen/Types.hsc +25/−3
- tests/Tests.hs +10/−0
hen.cabal view
@@ -1,5 +1,5 @@ Name: hen-Version: 0.0.2+Version: 0.0.3 Synopsis: Haskell bindings to Xen hypervisor interface Description: Haskell bindings to Xen hypervisor interface License: MIT@@ -22,13 +22,13 @@ Default-language: Haskell2010 Build-depends: base == 4.6.* || == 4.5.*- , containers == 0.5.*- , mtl == 2.1.*+ , containers == 0.5.* || == 0.4.*+ , mtl == 2.1.* || == 2.0.* , transformers-base == 0.4.* , lifted-base == 0.2.* , monad-control == 0.3.* , uuid == 1.2.*- , bitset == 1.3.*+ , bitset == 1.4.* Exposed-modules: System.Xen System.Xen.High@@ -37,6 +37,26 @@ System.Xen.Mid System.Xen.Low Extra-libraries: xenctrl++Test-suite hen-tests+ Main-is: Tests.hs+ Hs-source-dirs: src, tests+ Default-language: Haskell2010+ Type: exitcode-stdio-1.0++ Build-depends: base == 4.6.* || == 4.5.*+ , containers == 0.5.* || == 0.4.*+ , mtl == 2.1.* || == 2.0.*+ , transformers-base == 0.4.*+ , lifted-base == 0.2.*+ , monad-control == 0.3.*+ , uuid == 1.2.*+ , bitset == 1.3.*+ , hen++ , test-framework == 0.8.*+ , test-framework-quickcheck2 == 0.3.*+ , QuickCheck == 2.5.* Source-repository head Type: git
src/System/Xen/Types.hsc view
@@ -17,11 +17,12 @@ #let alignment t = "%lu", (unsigned long) offsetof(struct {char x__; t (y__); }, y__) -import Prelude hiding (elem)+import Prelude hiding (elem, foldl) import Control.Applicative ((<$>))-import Data.Bits (testBit)+import Data.Bits (testBit, bit, (.|.)) import Data.Maybe (catMaybes)+import Data.Foldable (foldl) import Data.Word (Word32, Word64) import Foreign.C (CInt(..), CUInt(..)) #if XEN_SYSCTL_INTERFACE_VERSION == 8@@ -149,4 +150,25 @@ domainInfoCpuPool <- #{peek xc_dominfo_t, cpupool} ptr #endif return $ DomainInfo { .. }- poke = error "Storable DomainInfo poke: not implemented"+ poke ptr DomainInfo { .. } = do+ #{poke xc_dominfo_t, domid} ptr domainInfoId+ #{poke xc_dominfo_t, ssidref} ptr domainInfoSsidRef+ let off = sizeOf domainInfoId + sizeOf domainInfoSsidRef+ let flags :: CUInt = foldl (\a b -> a .|. bit (fromEnum b)) 0 domainInfoFlags+ pokeByteOff ptr off flags+ case domainInfoShutdownReason of+ Nothing -> return ()+ Just reason -> #{poke xc_dominfo_t, shutdown_reason} ptr reason+ #{poke xc_dominfo_t, nr_pages} ptr domainInfoNumberOfPages+#if XEN_SYSCTL_INTERFACE_VERSION == 8+ #{poke xc_dominfo_t, nr_shared_pages} ptr domainInfoNumberOfSharedPages+#endif+ #{poke xc_dominfo_t, shared_info_frame} ptr domainInfoSharedInfoFrame+ #{poke xc_dominfo_t, cpu_time} ptr domainInfoCpuTime+ #{poke xc_dominfo_t, max_memkb} ptr domainInfoMaxMemKb+ #{poke xc_dominfo_t, nr_online_vcpus} ptr domainInfoNubmerOfOnlineVcpus+ #{poke xc_dominfo_t, max_vcpu_id} ptr domainInfoMaxVcpuId+ #{poke xc_dominfo_t, handle} ptr domainInfoDomHandle+#if XEN_SYSCTL_INTERFACE_VERSION == 8+ #{poke xc_dominfo_t, cpupool} ptr domainInfoCpuPool+#endif
+ tests/Tests.hs view
@@ -0,0 +1,10 @@+module Main where++import Test.Framework (defaultMain)++import qualified System.Xen.Types.Tests++main :: IO ()+main = defaultMain+ [ System.Xen.Types.Tests.tests+ ]