hen-0.1.1: Haskell bindings to Xen hypervisor interface

Safe HaskellNone

System.Xen.High

Contents

Description

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

Synopsis

Monad stuff

data XenT m a Source

A Xen transformer. This transformers keeps connection to the Xen hypervisor interface.

Instances

MonadTrans XenT 
MonadRWS r w s m => MonadRWS r w s (XenT m) 
MonadReader r m => MonadReader r (XenT m) 
MonadState s m => MonadState s (XenT m) 
MonadWriter w m => MonadWriter w (XenT m) 
Monad m => Monad (XenT m) 
Functor m => Functor (XenT m) 
Applicative m => Applicative (XenT m) 
MonadCatch m => MonadCatch (XenT m) 
MonadIO m => MonadIO (XenT m) 
(Functor m, MonadIO m, MonadCatch m) => MonadXen (XenT m) 

type Xen = XenT IOSource

Most simple XenT implementation.

runXenT :: (Functor m, MonadIO m, MonadCatch m) => XenT m 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.

Domain

domainGetInfo :: MonadXen m => m [DomainInfo]Source

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

Domain pause

domainPause :: MonadXen m => DomId -> m BoolSource

Pause domain. A paused domain still exists in memory however it does not receive any timeslices from the hypervisor.

domainUnpause :: MonadXen m => DomId -> m BoolSource

Unpause a domain. The domain should have been previously paused.

Domain powerstate

domainShutdown :: MonadXen m => DomId -> DomainShutdownReason -> m BoolSource

Shutdown domain. This is intended for use in fully-virtualized domains where this operation is analogous to the sched_op operations in a paravirtualized domain.

domainDestroy :: MonadXen m => DomId -> m BoolSource

Destroy a domain. Destroying a domain removes the domain completely from memory. This function should be called after domainShutdown to free up the domain resources.