# Module Libvirt.Virterror

    module Virterror: sig .. end

Module dealing with errors.

    type code =

`|` | `VIR_ERR_OK`
`|` | `VIR_ERR_INTERNAL_ERROR`
`|` | `VIR_ERR_NO_MEMORY`
`|` | `VIR_ERR_NO_SUPPORT`
`|` | `VIR_ERR_UNKNOWN_HOST`
`|` | `VIR_ERR_NO_CONNECT`
`|` | `VIR_ERR_INVALID_CONN`
`|` | `VIR_ERR_INVALID_DOMAIN`
`|` | `VIR_ERR_INVALID_ARG`
`|` | `VIR_ERR_OPERATION_FAILED`
`|` | `VIR_ERR_GET_FAILED`
`|` | `VIR_ERR_POST_FAILED`
`|` | `VIR_ERR_HTTP_ERROR`
`|` | `VIR_ERR_SEXPR_SERIAL`
`|` | `VIR_ERR_NO_XEN`
`|` | `VIR_ERR_XEN_CALL`
`|` | `VIR_ERR_OS_TYPE`
`|` | `VIR_ERR_NO_KERNEL`
`|` | `VIR_ERR_NO_ROOT`
`|` | `VIR_ERR_NO_SOURCE`
`|` | `VIR_ERR_NO_TARGET`
`|` | `VIR_ERR_NO_NAME`
`|` | `VIR_ERR_NO_OS`
`|` | `VIR_ERR_NO_DEVICE`
`|` | `VIR_ERR_NO_XENSTORE`
`|` | `VIR_ERR_DRIVER_FULL`
`|` | `VIR_ERR_CALL_FAILED`
`|` | `VIR_ERR_XML_ERROR`
`|` | `VIR_ERR_DOM_EXIST`
`|` | `VIR_ERR_OPERATION_DENIED`
`|` | `VIR_ERR_OPEN_FAILED`
`|` | `VIR_ERR_READ_FAILED`
`|` | `VIR_ERR_PARSE_FAILED`
`|` | `VIR_ERR_CONF_SYNTAX`
`|` | `VIR_ERR_WRITE_FAILED`
`|` | `VIR_ERR_XML_DETAIL`
`|` | `VIR_ERR_INVALID_NETWORK`
`|` | `VIR_ERR_NETWORK_EXIST`
`|` | `VIR_ERR_SYSTEM_ERROR`
`|` | `VIR_ERR_RPC`
`|` | `VIR_ERR_GNUTLS_ERROR`
`|` | `VIR_WAR_NO_NETWORK`
`|` | `VIR_ERR_NO_DOMAIN`
`|` | `VIR_ERR_NO_NETWORK`
`|` | `VIR_ERR_INVALID_MAC`
`|` | `VIR_ERR_AUTH_FAILED`
`|` | `VIR_ERR_INVALID_STORAGE_POOL`
`|` | `VIR_ERR_INVALID_STORAGE_VOL`
`|` | `VIR_WAR_NO_STORAGE`
`|` | `VIR_ERR_NO_STORAGE_POOL`
`|` | `VIR_ERR_NO_STORAGE_VOL`
`|` | `VIR_WAR_NO_NODE`
`|` | `VIR_ERR_INVALID_NODE_DEVICE`
`|` | `VIR_ERR_NO_NODE_DEVICE`
`|` | `VIR_ERR_NO_SECURITY_MODEL`
`|` | `VIR_ERR_OPERATION_INVALID`
`|` | `VIR_WAR_NO_INTERFACE`
`|` | `VIR_ERR_NO_INTERFACE`
`|` | `VIR_ERR_INVALID_INTERFACE`
`|` | `VIR_ERR_MULTIPLE_INTERFACES`
`|` | `VIR_WAR_NO_NWFILTER`
`|` | `VIR_ERR_INVALID_NWFILTER`
`|` | `VIR_ERR_NO_NWFILTER`
`|` | `VIR_ERR_BUILD_FIREWALL`
`|` | `VIR_WAR_NO_SECRET`
`|` | `VIR_ERR_INVALID_SECRET`
`|` | `VIR_ERR_NO_SECRET`
`|` | `VIR_ERR_CONFIG_UNSUPPORTED`
`|` | `VIR_ERR_OPERATION_TIMEOUT`
`|` | `VIR_ERR_MIGRATE_PERSIST_FAILED`
`|` | `VIR_ERR_HOOK_SCRIPT_FAILED`
`|` | `VIR_ERR_INVALID_DOMAIN_SNAPSHOT`
`|` | `VIR_ERR_NO_DOMAIN_SNAPSHOT`
`|` | `VIR_ERR_INVALID_STREAM`
`|` | `VIR_ERR_ARGUMENT_UNSUPPORTED`
`|` | `VIR_ERR_STORAGE_PROBE_FAILED`
`|` | `VIR_ERR_STORAGE_POOL_BUILT`
`|` | `VIR_ERR_SNAPSHOT_REVERT_RISKY`
`|` | `VIR_ERR_OPERATION_ABORTED`
`|` | `VIR_ERR_AUTH_CANCELLED`
`|` | `VIR_ERR_NO_DOMAIN_METADATA`
`|` | `VIR_ERR_MIGRATE_UNSAFE`
`|` | `VIR_ERR_OVERFLOW`
`|` | `VIR_ERR_BLOCK_COPY_ACTIVE`
`|` | `VIR_ERR_OPERATION_UNSUPPORTED`
`|` | `VIR_ERR_SSH`
`|` | `VIR_ERR_AGENT_UNRESPONSIVE`
`|` | `VIR_ERR_RESOURCE_BUSY`
`|` | `VIR_ERR_ACCESS_DENIED`
`|` | `VIR_ERR_DBUS_SERVICE`
`|` | `VIR_ERR_STORAGE_VOL_EXIST`
`|` | `VIR_ERR_CPU_INCOMPATIBLE`
`|` | `VIR_ERR_XML_INVALID_SCHEMA`
`|` | `VIR_ERR_MIGRATE_FINISH_OK`
`|` | `VIR_ERR_AUTH_UNAVAILABLE`
`|` | `VIR_ERR_NO_SERVER`
`|` | `VIR_ERR_NO_CLIENT`
`|` | `VIR_ERR_AGENT_UNSYNCED`
`|` | `VIR_ERR_LIBSSH`
`|` | `VIR_ERR_DEVICE_MISSING`
`|` | `VIR_ERR_INVALID_NWFILTER_BINDING`
`|` | `VIR_ERR_NO_NWFILTER_BINDING`
`|` | `VIR_ERR_INVALID_DOMAIN_CHECKPOINT`
`|` | `VIR_ERR_NO_DOMAIN_CHECKPOINT`
`|` | `VIR_ERR_NO_DOMAIN_BACKUP`
`|` | `VIR_ERR_INVALID_NETWORK_PORT`
`|` | `VIR_ERR_NETWORK_PORT_EXIST`
`|` | `VIR_ERR_NO_NETWORK_PORT`
`|` | `VIR_ERR_UNKNOWN of `int`` | `(*` | Other error, not handled with existing values. | `*)`

See `<libvirt/virterror.h>` for meaning of these codes.

    val string_of_code : code -> string

    type domain =

`|` | `VIR_FROM_NONE`
`|` | `VIR_FROM_XEN`
`|` | `VIR_FROM_XEND`
`|` | `VIR_FROM_XENSTORE`
`|` | `VIR_FROM_SEXPR`
`|` | `VIR_FROM_XML`
`|` | `VIR_FROM_DOM`
`|` | `VIR_FROM_RPC`
`|` | `VIR_FROM_PROXY`
`|` | `VIR_FROM_CONF`
`|` | `VIR_FROM_QEMU`
`|` | `VIR_FROM_NET`
`|` | `VIR_FROM_TEST`
`|` | `VIR_FROM_REMOTE`
`|` | `VIR_FROM_OPENVZ`
`|` | `VIR_FROM_XENXM`
`|` | `VIR_FROM_STATS_LINUX`
`|` | `VIR_FROM_LXC`
`|` | `VIR_FROM_STORAGE`
`|` | `VIR_FROM_NETWORK`
`|` | `VIR_FROM_DOMAIN`
`|` | `VIR_FROM_UML`
`|` | `VIR_FROM_NODEDEV`
`|` | `VIR_FROM_XEN_INOTIFY`
`|` | `VIR_FROM_SECURITY`
`|` | `VIR_FROM_VBOX`
`|` | `VIR_FROM_INTERFACE`
`|` | `VIR_FROM_ONE`
`|` | `VIR_FROM_ESX`
`|` | `VIR_FROM_PHYP`
`|` | `VIR_FROM_SECRET`
`|` | `VIR_FROM_CPU`
`|` | `VIR_FROM_XENAPI`
`|` | `VIR_FROM_NWFILTER`
`|` | `VIR_FROM_HOOK`
`|` | `VIR_FROM_DOMAIN_SNAPSHOT`
`|` | `VIR_FROM_AUDIT`
`|` | `VIR_FROM_SYSINFO`
`|` | `VIR_FROM_STREAMS`
`|` | `VIR_FROM_VMWARE`
`|` | `VIR_FROM_EVENT`
`|` | `VIR_FROM_LIBXL`
`|` | `VIR_FROM_LOCKING`
`|` | `VIR_FROM_HYPERV`
`|` | `VIR_FROM_CAPABILITIES`
`|` | `VIR_FROM_URI`
`|` | `VIR_FROM_AUTH`
`|` | `VIR_FROM_DBUS`
`|` | `VIR_FROM_PARALLELS`
`|` | `VIR_FROM_DEVICE`
`|` | `VIR_FROM_SSH`
`|` | `VIR_FROM_LOCKSPACE`
`|` | `VIR_FROM_INITCTL`
`|` | `VIR_FROM_IDENTITY`
`|` | `VIR_FROM_CGROUP`
`|` | `VIR_FROM_ACCESS`
`|` | `VIR_FROM_SYSTEMD`
`|` | `VIR_FROM_BHYVE`
`|` | `VIR_FROM_CRYPTO`
`|` | `VIR_FROM_FIREWALL`
`|` | `VIR_FROM_POLKIT`
`|` | `VIR_FROM_THREAD`
`|` | `VIR_FROM_ADMIN`
`|` | `VIR_FROM_LOGGING`
`|` | `VIR_FROM_XENXL`
`|` | `VIR_FROM_PERF`
`|` | `VIR_FROM_LIBSSH`
`|` | `VIR_FROM_RESCTRL`
`|` | `VIR_FROM_FIREWALLD`
`|` | `VIR_FROM_DOMAIN_CHECKPOINT`
`|` | `VIR_FROM_TPM`
`|` | `VIR_FROM_UNKNOWN of `int`` | `(*` | Other domain, not handled with existing values. | `*)`

Subsystem / driver which produced the error.

    val string_of_domain : domain -> string

    type level =

`|` | `VIR_ERR_NONE`
`|` | `VIR_ERR_WARNING`
`|` | `VIR_ERR_ERROR`
`|` | `VIR_ERR_UNKNOWN_LEVEL of `int`` | `(*` | Other level, not handled with existing values. | `*)`

No error, a warning or an error.

    val string_of_level : level -> string

    type t = {

`` | `code : `code`;` | `(*` | Error code. | `*)`
`` | `domain : `domain`;` | `(*` | Origin of the error. | `*)`
`` | `message : `string option`;` | `(*` | Human-readable message. | `*)`
`` | `level : `level`;` | `(*` | Error or warning. | `*)`
`` | `str1 : `string option`;` | `(*` | Informational string. | `*)`
`` | `str2 : `string option`;` | `(*` | Informational string. | `*)`
`` | `str3 : `string option`;` | `(*` | Informational string. | `*)`
`` | `int1 : `int32`;` | `(*` | Informational integer. | `*)`
`` | `int2 : `int32`;` | `(*` | Informational integer. | `*)`

}

An error object.

    val to_string : t -> string

Turn the exception into a printable string.

    val get_last_error : unit -> t option

    val get_last_conn_error : [> `R ] Libvirt.Connect.t -> t option

Get the last error at a global or connection level.

Normally you do not need to use these functions because the library automatically turns errors into exceptions.

    val reset_last_error : unit -> unit

    val reset_last_conn_error : [> `R ] Libvirt.Connect.t -> unit

Reset the error at a global or connection level.

Normally you do not need to use these functions.

    val no_error : unit -> t

Creates an empty error message.

Normally you do not need to use this function.