hen-0.0.3: Haskell bindings to Xen hypervisor interface

Safe HaskellNone

System.Xen.High

Description

High-level interface to XenCtrl. Contains Xen monad and provides a safe way to run any Xen computation.

Synopsis

Documentation

data Xen a Source

This is a special monad for operations with XenCtrl, it's a wrapper around ReaderT transformer and it controls the connection to the hypervisor. Because Xen has instances of and MonadBase and MonadBaseControl over IO, you can use any functions of lifted-base library, or any IO with liftBase.

domainGetInfo :: Xen [DomainInfo]Source

Returns a lift of domains, this function can fail with InvalidDomainShutdownReason and DomainGetInfoError.

withXenHandle :: (XcHandle -> Xen a) -> Xen aSource

Helper function for creating high-level interface functions from mid-level. Generally high-level function is just highLevel = withXenHandle midLevel.

runXen :: MonadBaseControl IO m => Xen a -> m (Either SomeException a)Source

Open new connection to the hypervisor, run any Xen action and close connection if nessesary. This function can fail with Either SomeException with XcHandleOpenError and any error of providing Xen action.