Safe Haskell | None |
---|
Mid-level interface to XenCtrl
. Functions that provided by this module are
version-independent from Xen
and raise real exceptions instead of confusing
error codes and errno
.
- interfaceOpen :: MonadIO m => m XcHandle
- interfaceClose :: (MonadIO m, Functor m) => XcHandle -> m ()
- domainGetInfo :: (MonadIO m, Alternative t, Traversable t) => XcHandle -> m (t DomainInfo)
- domainPause :: MonadIO m => DomId -> XcHandle -> m Bool
- domainUnpause :: MonadIO m => DomId -> XcHandle -> m Bool
- domainShutdown :: MonadIO m => DomId -> DomainShutdownReason -> XcHandle -> m Bool
- domainDestroy :: MonadIO m => DomId -> XcHandle -> m Bool
Interface
interfaceOpen :: MonadIO m => m XcHandleSource
Open the connection to the hypervisor interface, can fail with
XcHandleOpenError
.
interfaceClose :: (MonadIO m, Functor m) => XcHandle -> m ()Source
Close an open hypervisor interface, ignores all possible errors but all the same can fail with segfault or sutin.
Domain
domainGetInfo :: (MonadIO m, Alternative t, Traversable t) => XcHandle -> m (t DomainInfo)Source
Returns a list of currently runing domains, 1024 maximum, can fail with
InvalidDomainShutdownReason
and
DomainGetInfoError
.
Domain pause
domainPause :: MonadIO m => DomId -> XcHandle -> m BoolSource
Pause domain. A paused domain still exists in memory however it does not receive any timeslices from the hypervisor.
domainUnpause :: MonadIO m => DomId -> XcHandle -> m BoolSource
Unpause a domain. The domain should have been previously paused.
Domain powerstate
domainShutdown :: MonadIO m => DomId -> DomainShutdownReason -> XcHandle -> 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 :: MonadIO m => DomId -> XcHandle -> 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.