Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Erlang interface to the libvirtd remote protocol

Initial commit of code to talk to the libvirt daemon using XDR over a Unix
socket. Some of the code was generated from libvirt's remote_protocol.x
using adhoc scripts.
  • Loading branch information...
commit 1e5f4beb2942e4db3a6c29a9ce07981cde7d4e59 0 parents
@msantos authored
3  .gitignore
@@ -0,0 +1,3 @@
+*.[oa]
+*.beam
+*.swp
17 Makefile
@@ -0,0 +1,17 @@
+
+REBAR=$(shell which rebar || echo ./rebar)
+
+all: compile
+
+./rebar:
+ erl -noshell -s inets start -s ssl start \
+ -eval 'httpc:request(get, {"https://github.com/downloads/basho/rebar/rebar", []}, [], [{stream, "./rebar"}])' \
+ -s inets stop -s init stop
+ chmod +x ./rebar
+
+compile: $(REBAR)
+ @$(REBAR) compile
+
+clean: $(REBAR)
+ @$(REBAR) clean
+
18 README.md
@@ -0,0 +1,18 @@
+(almost) pure Erlang implementation of the libvirtd remote protocol.
+
+For an Erlang binding to the C libvirt interface, see:
+
+https://github.com/msantos/erlang-libvirt
+
+## WARNING
+
+## HOW TO BUILD IT
+
+make
+
+## HOW TO USE IT
+
+## EXAMPLES
+
+## TODO
+
22 ebin/verx.app
@@ -0,0 +1,22 @@
+{application, verx,
+ [
+ {description, "Erlang libvirtd remote protocol"},
+ {vsn, "0.01"},
+ {modules, [
+ verx,
+ verx_rpc,
+ verx_xdr,
+ verx_arg,
+ verx_proto,
+ verx_constant,
+ verx_util,
+ verx_err
+ ]},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]},
+ {env, []}
+ ]}.
+
256 include/verx.hrl
@@ -0,0 +1,256 @@
+%% Copyright (c) 2010-2011, Michael Santos <michael.santos@gmail.com>
+%% All rights reserved.
+%%
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions
+%% are met:
+%%
+%% Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in the
+%% documentation and/or other materials provided with the distribution.
+%%
+%% Neither the name of the author nor the names of its contributors
+%% may be used to endorse or promote products derived from this software
+%% without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGE.
+
+-define(REMOTE_PROGRAM, 16#20008086).
+-define(REMOTE_PROTOCOL_VERSION, 1).
+
+%% remote_procedure
+-define(REMOTE_PROC_OPEN, 1).
+-define(REMOTE_PROC_CLOSE, 2).
+-define(REMOTE_PROC_GET_TYPE, 3).
+-define(REMOTE_PROC_GET_VERSION, 4).
+-define(REMOTE_PROC_GET_MAX_VCPUS, 5).
+-define(REMOTE_PROC_NODE_GET_INFO, 6).
+-define(REMOTE_PROC_GET_CAPABILITIES, 7).
+-define(REMOTE_PROC_DOMAIN_ATTACH_DEVICE, 8).
+-define(REMOTE_PROC_DOMAIN_CREATE, 9).
+-define(REMOTE_PROC_DOMAIN_CREATE_XML, 10).
+
+-define(REMOTE_PROC_DOMAIN_DEFINE_XML, 11).
+-define(REMOTE_PROC_DOMAIN_DESTROY, 12).
+-define(REMOTE_PROC_DOMAIN_DETACH_DEVICE, 13).
+-define(REMOTE_PROC_DOMAIN_DUMP_XML, 14).
+-define(REMOTE_PROC_DOMAIN_GET_AUTOSTART, 15).
+-define(REMOTE_PROC_DOMAIN_GET_INFO, 16).
+-define(REMOTE_PROC_DOMAIN_GET_MAX_MEMORY, 17).
+-define(REMOTE_PROC_DOMAIN_GET_MAX_VCPUS, 18).
+-define(REMOTE_PROC_DOMAIN_GET_OS_TYPE, 19).
+-define(REMOTE_PROC_DOMAIN_GET_VCPUS, 20).
+
+-define(REMOTE_PROC_LIST_DEFINED_DOMAINS, 21).
+-define(REMOTE_PROC_DOMAIN_LOOKUP_BY_ID, 22).
+-define(REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME, 23).
+-define(REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID, 24).
+-define(REMOTE_PROC_NUM_OF_DEFINED_DOMAINS, 25).
+-define(REMOTE_PROC_DOMAIN_PIN_VCPU, 26).
+-define(REMOTE_PROC_DOMAIN_REBOOT, 27).
+-define(REMOTE_PROC_DOMAIN_RESUME, 28).
+-define(REMOTE_PROC_DOMAIN_SET_AUTOSTART, 29).
+-define(REMOTE_PROC_DOMAIN_SET_MAX_MEMORY, 30).
+
+-define(REMOTE_PROC_DOMAIN_SET_MEMORY, 31).
+-define(REMOTE_PROC_DOMAIN_SET_VCPUS, 32).
+-define(REMOTE_PROC_DOMAIN_SHUTDOWN, 33).
+-define(REMOTE_PROC_DOMAIN_SUSPEND, 34).
+-define(REMOTE_PROC_DOMAIN_UNDEFINE, 35).
+-define(REMOTE_PROC_LIST_DEFINED_NETWORKS, 36).
+-define(REMOTE_PROC_LIST_DOMAINS, 37).
+-define(REMOTE_PROC_LIST_NETWORKS, 38).
+-define(REMOTE_PROC_NETWORK_CREATE, 39).
+-define(REMOTE_PROC_NETWORK_CREATE_XML, 40).
+
+-define(REMOTE_PROC_NETWORK_DEFINE_XML, 41).
+-define(REMOTE_PROC_NETWORK_DESTROY, 42).
+-define(REMOTE_PROC_NETWORK_DUMP_XML, 43).
+-define(REMOTE_PROC_NETWORK_GET_AUTOSTART, 44).
+-define(REMOTE_PROC_NETWORK_GET_BRIDGE_NAME, 45).
+-define(REMOTE_PROC_NETWORK_LOOKUP_BY_NAME, 46).
+-define(REMOTE_PROC_NETWORK_LOOKUP_BY_UUID, 47).
+-define(REMOTE_PROC_NETWORK_SET_AUTOSTART, 48).
+-define(REMOTE_PROC_NETWORK_UNDEFINE, 49).
+-define(REMOTE_PROC_NUM_OF_DEFINED_NETWORKS, 50).
+
+-define(REMOTE_PROC_NUM_OF_DOMAINS, 51).
+-define(REMOTE_PROC_NUM_OF_NETWORKS, 52).
+-define(REMOTE_PROC_DOMAIN_CORE_DUMP, 53).
+-define(REMOTE_PROC_DOMAIN_RESTORE, 54).
+-define(REMOTE_PROC_DOMAIN_SAVE, 55).
+-define(REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE, 56).
+-define(REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS, 57).
+-define(REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS, 58).
+-define(REMOTE_PROC_GET_HOSTNAME, 59).
+-define(REMOTE_PROC_SUPPORTS_FEATURE, 60).
+
+-define(REMOTE_PROC_DOMAIN_MIGRATE_PREPARE, 61).
+-define(REMOTE_PROC_DOMAIN_MIGRATE_PERFORM, 62).
+-define(REMOTE_PROC_DOMAIN_MIGRATE_FINISH, 63).
+-define(REMOTE_PROC_DOMAIN_BLOCK_STATS, 64).
+-define(REMOTE_PROC_DOMAIN_INTERFACE_STATS, 65).
+-define(REMOTE_PROC_AUTH_LIST, 66).
+-define(REMOTE_PROC_AUTH_SASL_INIT, 67).
+-define(REMOTE_PROC_AUTH_SASL_START, 68).
+-define(REMOTE_PROC_AUTH_SASL_STEP, 69).
+-define(REMOTE_PROC_AUTH_POLKIT, 70).
+
+-define(REMOTE_PROC_NUM_OF_STORAGE_POOLS, 71).
+-define(REMOTE_PROC_LIST_STORAGE_POOLS, 72).
+-define(REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS, 73).
+-define(REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS, 74).
+-define(REMOTE_PROC_FIND_STORAGE_POOL_SOURCES, 75).
+-define(REMOTE_PROC_STORAGE_POOL_CREATE_XML, 76).
+-define(REMOTE_PROC_STORAGE_POOL_DEFINE_XML, 77).
+-define(REMOTE_PROC_STORAGE_POOL_CREATE, 78).
+-define(REMOTE_PROC_STORAGE_POOL_BUILD, 79).
+-define(REMOTE_PROC_STORAGE_POOL_DESTROY, 80).
+
+-define(REMOTE_PROC_STORAGE_POOL_DELETE, 81).
+-define(REMOTE_PROC_STORAGE_POOL_UNDEFINE, 82).
+-define(REMOTE_PROC_STORAGE_POOL_REFRESH, 83).
+-define(REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME, 84).
+-define(REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID, 85).
+-define(REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME, 86).
+-define(REMOTE_PROC_STORAGE_POOL_GET_INFO, 87).
+-define(REMOTE_PROC_STORAGE_POOL_DUMP_XML, 88).
+-define(REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART, 89).
+-define(REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART, 90).
+
+-define(REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES, 91).
+-define(REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES, 92).
+-define(REMOTE_PROC_STORAGE_VOL_CREATE_XML, 93).
+-define(REMOTE_PROC_STORAGE_VOL_DELETE, 94).
+-define(REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME, 95).
+-define(REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY, 96).
+-define(REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH, 97).
+-define(REMOTE_PROC_STORAGE_VOL_GET_INFO, 98).
+-define(REMOTE_PROC_STORAGE_VOL_DUMP_XML, 99).
+-define(REMOTE_PROC_STORAGE_VOL_GET_PATH, 100).
+
+-define(REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY, 101).
+-define(REMOTE_PROC_NODE_GET_FREE_MEMORY, 102).
+-define(REMOTE_PROC_DOMAIN_BLOCK_PEEK, 103).
+-define(REMOTE_PROC_DOMAIN_MEMORY_PEEK, 104).
+-define(REMOTE_PROC_DOMAIN_EVENTS_REGISTER, 105).
+-define(REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER, 106).
+-define(REMOTE_PROC_DOMAIN_EVENT, 107).
+-define(REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2, 108).
+-define(REMOTE_PROC_DOMAIN_MIGRATE_FINISH2, 109).
+-define(REMOTE_PROC_GET_URI, 110).
+
+-define(REMOTE_PROC_NODE_NUM_OF_DEVICES, 111).
+-define(REMOTE_PROC_NODE_LIST_DEVICES, 112).
+-define(REMOTE_PROC_NODE_DEVICE_LOOKUP_BY_NAME, 113).
+-define(REMOTE_PROC_NODE_DEVICE_DUMP_XML, 114).
+-define(REMOTE_PROC_NODE_DEVICE_GET_PARENT, 115).
+-define(REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS, 116).
+-define(REMOTE_PROC_NODE_DEVICE_LIST_CAPS, 117).
+-define(REMOTE_PROC_NODE_DEVICE_DETTACH, 118).
+-define(REMOTE_PROC_NODE_DEVICE_RE_ATTACH, 119).
+-define(REMOTE_PROC_NODE_DEVICE_RESET, 120).
+
+-define(REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL, 121).
+-define(REMOTE_PROC_NODE_GET_SECURITY_MODEL, 122).
+-define(REMOTE_PROC_NODE_DEVICE_CREATE_XML, 123).
+-define(REMOTE_PROC_NODE_DEVICE_DESTROY, 124).
+-define(REMOTE_PROC_STORAGE_VOL_CREATE_XML_FROM, 125).
+-define(REMOTE_PROC_NUM_OF_INTERFACES, 126).
+-define(REMOTE_PROC_LIST_INTERFACES, 127).
+-define(REMOTE_PROC_INTERFACE_LOOKUP_BY_NAME, 128).
+-define(REMOTE_PROC_INTERFACE_LOOKUP_BY_MAC_STRING, 129).
+-define(REMOTE_PROC_INTERFACE_GET_XML_DESC, 130).
+
+-define(REMOTE_PROC_INTERFACE_DEFINE_XML, 131).
+-define(REMOTE_PROC_INTERFACE_UNDEFINE, 132).
+-define(REMOTE_PROC_INTERFACE_CREATE, 133).
+-define(REMOTE_PROC_INTERFACE_DESTROY, 134).
+-define(REMOTE_PROC_DOMAIN_XML_FROM_NATIVE, 135).
+-define(REMOTE_PROC_DOMAIN_XML_TO_NATIVE, 136).
+-define(REMOTE_PROC_NUM_OF_DEFINED_INTERFACES, 137).
+-define(REMOTE_PROC_LIST_DEFINED_INTERFACES, 138).
+-define(REMOTE_PROC_NUM_OF_SECRETS, 139).
+-define(REMOTE_PROC_LIST_SECRETS, 140).
+
+-define(REMOTE_PROC_SECRET_LOOKUP_BY_UUID, 141).
+-define(REMOTE_PROC_SECRET_DEFINE_XML, 142).
+-define(REMOTE_PROC_SECRET_GET_XML_DESC, 143).
+-define(REMOTE_PROC_SECRET_SET_VALUE, 144).
+-define(REMOTE_PROC_SECRET_GET_VALUE, 145).
+-define(REMOTE_PROC_SECRET_UNDEFINE, 146).
+-define(REMOTE_PROC_SECRET_LOOKUP_BY_USAGE, 147).
+-define(REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL, 148).
+-define(REMOTE_PROC_IS_SECURE, 149).
+-define(REMOTE_PROC_DOMAIN_IS_ACTIVE, 150).
+
+-define(REMOTE_PROC_DOMAIN_IS_PERSISTENT, 151).
+-define(REMOTE_PROC_NETWORK_IS_ACTIVE, 152).
+-define(REMOTE_PROC_NETWORK_IS_PERSISTENT, 153).
+-define(REMOTE_PROC_STORAGE_POOL_IS_ACTIVE, 154).
+-define(REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT, 155).
+-define(REMOTE_PROC_INTERFACE_IS_ACTIVE, 156).
+-define(REMOTE_PROC_GET_LIB_VERSION, 157).
+-define(REMOTE_PROC_CPU_COMPARE, 158).
+-define(REMOTE_PROC_DOMAIN_MEMORY_STATS, 159).
+
+%% remote_message_type
+-define(REMOTE_CALL, 0).
+-define(REMOTE_REPLY, 1).
+-define(REMOTE_MESSAGE, 2).
+-define(REMOTE_STREAM, 3).
+
+%% remote_message_status
+-define(REMOTE_OK, 0).
+-define(REMOTE_ERROR, 1).
+-define(REMOTE_CONTINUE, 2).
+
+%% Various limits which we will promptly ignore
+-define(REMOTE_MESSAGE_MAX, 262144).
+-define(REMOTE_STRING_MAX, 65536).
+
+
+%% Message format:
+%% total length of message in bytes
+%% header
+%% payload
+-record(remote_message_header, {
+ prog = ?REMOTE_PROGRAM,
+ vers = ?REMOTE_PROTOCOL_VERSION,
+ proc = ?REMOTE_PROC_OPEN,
+ type = ?REMOTE_CALL,
+ serial = 0,
+ status = ?REMOTE_OK
+ }).
+
+
+-define(VIR_UUID_BUFLEN, 16).
+
+-record(message, {
+ len = 0,
+ header = #remote_message_header{},
+ payload = <<>>
+ }).
+
+
+
+-record(socket, {
+ s, % int fd
+ sun % struct sockaddr_un
+ }).
+
+
105 include/verx_err.hrl
@@ -0,0 +1,105 @@
+-define(VIR_ERR_NONE, 0).
+-define(VIR_ERR_WARNING, 1).
+-define(VIR_ERR_ERROR, 2).
+
+-define(VIR_FROM_NONE, 0).
+-define(VIR_FROM_XEN, 1).
+-define(VIR_FROM_XEND, 2).
+-define(VIR_FROM_XENSTORE, 3).
+-define(VIR_FROM_SEXPR, 4).
+-define(VIR_FROM_XML, 5).
+-define(VIR_FROM_DOM, 6).
+-define(VIR_FROM_RPC, 7).
+-define(VIR_FROM_PROXY, 8).
+-define(VIR_FROM_CONF, 9).
+-define(VIR_FROM_QEMU, 10).
+-define(VIR_FROM_NET, 11).
+-define(VIR_FROM_TEST, 12).
+-define(VIR_FROM_REMOTE, 13).
+-define(VIR_FROM_OPENVZ, 14).
+-define(VIR_FROM_XENXM, 15).
+-define(VIR_FROM_STATS_LINUX, 16).
+-define(VIR_FROM_LXC, 17).
+-define(VIR_FROM_STORAGE, 18).
+-define(VIR_FROM_NETWORK, 19).
+-define(VIR_FROM_DOMAIN, 20).
+-define(VIR_FROM_UML, 21).
+-define(VIR_FROM_NODEDEV, 22).
+-define(VIR_FROM_XEN_INOTIFY, 23).
+-define(VIR_FROM_SECURITY, 24).
+-define(VIR_FROM_VBOX, 25).
+-define(VIR_FROM_INTERFACE, 26).
+-define(VIR_FROM_ONE, 27).
+-define(VIR_FROM_ESX, 28).
+-define(VIR_FROM_PHYP, 29).
+-define(VIR_FROM_SECRET, 30).
+-define(VIR_FROM_CPU, 31).
+
+
+-define(VIR_ERR_OK, 0).
+-define(VIR_ERR_INTERNAL_ERROR, 1).
+-define(VIR_ERR_NO_MEMORY, 2).
+-define(VIR_ERR_NO_SUPPORT, 3).
+-define(VIR_ERR_UNKNOWN_HOST, 4).
+-define(VIR_ERR_NO_CONNECT, 5).
+-define(VIR_ERR_INVALID_CONN, 6).
+-define(VIR_ERR_INVALID_DOMAIN, 7).
+-define(VIR_ERR_INVALID_ARG, 8).
+-define(VIR_ERR_OPERATION_FAILED, 9).
+-define(VIR_ERR_GET_FAILED, 10).
+-define(VIR_ERR_POST_FAILED, 11).
+-define(VIR_ERR_HTTP_ERROR, 12).
+-define(VIR_ERR_SEXPR_SERIAL, 13).
+-define(VIR_ERR_NO_XEN, 14).
+-define(VIR_ERR_XEN_CALL, 15).
+-define(VIR_ERR_OS_TYPE, 16).
+-define(VIR_ERR_NO_KERNEL, 17).
+-define(VIR_ERR_NO_ROOT, 18).
+-define(VIR_ERR_NO_SOURCE, 19).
+-define(VIR_ERR_NO_TARGET, 20).
+-define(VIR_ERR_NO_NAME, 21).
+-define(VIR_ERR_NO_OS, 22).
+-define(VIR_ERR_NO_DEVICE, 23).
+-define(VIR_ERR_NO_XENSTORE, 24).
+-define(VIR_ERR_DRIVER_FULL, 25).
+-define(VIR_ERR_CALL_FAILED, 26).
+-define(VIR_ERR_XML_ERROR, 27).
+-define(VIR_ERR_DOM_EXIST, 28).
+-define(VIR_ERR_OPERATION_DENIED, 29).
+-define(VIR_ERR_OPEN_FAILED, 30).
+-define(VIR_ERR_READ_FAILED, 31).
+-define(VIR_ERR_PARSE_FAILED, 32).
+-define(VIR_ERR_CONF_SYNTAX, 33).
+-define(VIR_ERR_WRITE_FAILED, 34).
+-define(VIR_ERR_XML_DETAIL, 35).
+-define(VIR_ERR_INVALID_NETWORK, 36).
+-define(VIR_ERR_NETWORK_EXIST, 37).
+-define(VIR_ERR_SYSTEM_ERROR, 38).
+-define(VIR_ERR_RPC, 39).
+-define(VIR_ERR_GNUTLS_ERROR, 40).
+-define(VIR_WAR_NO_NETWORK, 41).
+-define(VIR_ERR_NO_DOMAIN, 42).
+-define(VIR_ERR_NO_NETWORK, 43).
+-define(VIR_ERR_INVALID_MAC, 44).
+-define(VIR_ERR_AUTH_FAILED, 45).
+-define(VIR_ERR_INVALID_STORAGE_POOL, 46).
+-define(VIR_ERR_INVALID_STORAGE_VOL, 47).
+-define(VIR_WAR_NO_STORAGE, 48).
+-define(VIR_ERR_NO_STORAGE_POOL, 49).
+-define(VIR_ERR_NO_STORAGE_VOL, 50).
+-define(VIR_WAR_NO_NODE, 51).
+-define(VIR_ERR_INVALID_NODE_DEVICE, 52).
+-define(VIR_ERR_NO_NODE_DEVICE, 53).
+-define(VIR_ERR_NO_SECURITY_MODEL, 54).
+-define(VIR_ERR_OPERATION_INVALID, 55).
+-define(VIR_WAR_NO_INTERFACE, 56).
+-define(VIR_ERR_NO_INTERFACE, 57).
+-define(VIR_ERR_INVALID_INTERFACE, 58).
+-define(VIR_ERR_MULTIPLE_INTERFACES, 59).
+-define(VIR_WAR_NO_SECRET, 60).
+-define(VIR_ERR_INVALID_SECRET, 61).
+-define(VIR_ERR_NO_SECRET, 62).
+-define(VIR_ERR_CONFIG_UNSUPPORTED, 63).
+-define(VIR_ERR_OPERATION_TIMEOUT, 64).
+-define(VIR_ERR_MIGRATE_PERSIST_FAILED, 65).
+
5 rebar.config
@@ -0,0 +1,5 @@
+{deps, [
+ {procket, ".*", {git, "git://github.com/msantos/procket.git", "master"}}
+ ]}.
+
+{erl_opts, [{i, "deps/procket/include"}]}.
106 src/verx.erl
@@ -0,0 +1,106 @@
+%% Copyright (c) 2011, Michael Santos <michael.santos@gmail.com>
+%% All rights reserved.
+%%
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions
+%% are met:
+%%
+%% Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in the
+%% documentation and/or other materials provided with the distribution.
+%%
+%% Neither the name of the author nor the names of its contributors
+%% may be used to endorse or promote products derived from this software
+%% without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGE.
+-module(verx).
+-include("verx.hrl").
+
+-export([
+ info/0, info/1,
+ capabilities/0,
+
+ create/0, create/1,
+ list_domains/0, list_domains/1,
+
+ destroy/1,
+ id/1,
+
+ send/1, send/2
+ ]).
+
+-define(XML_PATH, "/var/tmp/iso/qemu/demo1.xml").
+
+
+%%-------------------------------------------------------------------------
+%%% API
+%%-------------------------------------------------------------------------
+info() ->
+ info(node).
+
+info(node) ->
+ send(node_get_info);
+info({domain, UUID}) when is_binary(UUID) ->
+ send(domain_get_info, [
+ verx_xdr:encode({string, ""}), % name
+ UUID, % UUID
+ verx_xdr:encode({int, 0}) % id
+ ]).
+
+id(N) ->
+ send(domain_lookup_by_id, [
+ verx_xdr:encode({int, N}) % domain id
+ ]).
+
+capabilities() ->
+ send(get_capabilities).
+
+create() ->
+ create(?XML_PATH).
+create(Path) ->
+ {ok, Bin} = file:read_file(Path),
+ send(domain_create_xml, [
+ verx_xdr:encode({string, Bin}), % XML
+ verx_xdr:encode({int, 0}) % flags
+ ]).
+
+list_domains() ->
+ list_domains(10).
+list_domains(N) ->
+ send(list_domains, [
+ verx_xdr:encode({int, N}) % number of domains
+ ]).
+
+destroy(UUID) ->
+ send(domain_destroy, [
+ verx_xdr:encode({string, ""}), % UUID, not checked?
+ UUID, % UUID, binary
+ verx_xdr:encode({int, 0}) % id, not checked
+ ]).
+
+send(Message) ->
+ send(Message, []).
+send(Message, Args) ->
+ {ok,S} = verx_rpc:open(),
+ Res = case Args of
+ [] -> verx_rpc:call(S, Message);
+ N -> verx_rpc:call(S, Message, list_to_binary(N))
+ end,
+ verx_rpc:close(S),
+ verx_rpc:response(Message, Res).
+
1,361 src/verx_arg.erl
@@ -0,0 +1,1361 @@
+%% Copyright (c) 2011, Michael Santos <michael.santos@gmail.com>
+%% All rights reserved.
+%%
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions
+%% are met:
+%%
+%% Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in the
+%% documentation and/or other materials provided with the distribution.
+%%
+%% Neither the name of the author nor the names of its contributors
+%% may be used to endorse or promote products derived from this software
+%% without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGE.
+-module(verx_arg).
+-export([
+ domain_lookup_by_uuid/1,
+ domain_lookup_by_uuid/0,
+ storage_pool_list_volumes/1,
+ storage_pool_list_volumes/0,
+ secret_lookup_by_usage/1,
+ secret_lookup_by_usage/0,
+ domain_events_deregister/0,
+ domain_shutdown/1,
+ domain_shutdown/0,
+ storage_vol_create_xml/1,
+ storage_vol_create_xml/0,
+ interface_define_xml/1,
+ interface_define_xml/0,
+ auth_sasl_init/0,
+ get_hostname/0,
+ num_of_defined_interfaces/0,
+ domain_events_register/0,
+ network_undefine/1,
+ network_undefine/0,
+ domain_create/1,
+ domain_create/0,
+ num_of_interfaces/0,
+ secret_lookup_by_uuid/1,
+ secret_lookup_by_uuid/0,
+ domain_pin_vcpu/1,
+ domain_pin_vcpu/0,
+ network_create_xml/1,
+ network_create_xml/0,
+ open/1,
+ open/0,
+ storage_vol_create_xml_from/1,
+ storage_vol_create_xml_from/0,
+ list_domains/1,
+ list_domains/0,
+ network_define_xml/1,
+ network_define_xml/0,
+ storage_vol_delete/1,
+ storage_vol_delete/0,
+ network_dump_xml/1,
+ network_dump_xml/0,
+ domain_reboot/1,
+ domain_reboot/0,
+ domain_set_memory/1,
+ domain_set_memory/0,
+ storage_pool_destroy/1,
+ storage_pool_destroy/0,
+ secret_define_xml/1,
+ secret_define_xml/0,
+ auth_polkit/0,
+ interface_lookup_by_mac_string/1,
+ interface_lookup_by_mac_string/0,
+ auth_sasl_start/1,
+ auth_sasl_start/0,
+ domain_interface_stats/1,
+ domain_interface_stats/0,
+ interface_destroy/1,
+ interface_destroy/0,
+ storage_pool_dump_xml/1,
+ storage_pool_dump_xml/0,
+ interface_get_xml_desc/1,
+ interface_get_xml_desc/0,
+ node_device_re_attach/1,
+ node_device_re_attach/0,
+ storage_pool_delete/1,
+ storage_pool_delete/0,
+ domain_get_max_vcpus/1,
+ domain_get_max_vcpus/0,
+ secret_get_value/1,
+ secret_get_value/0,
+ supports_feature/1,
+ supports_feature/0,
+ list_defined_interfaces/1,
+ list_defined_interfaces/0,
+ domain_lookup_by_name/1,
+ domain_lookup_by_name/0,
+ storage_pool_set_autostart/1,
+ storage_pool_set_autostart/0,
+ list_interfaces/1,
+ list_interfaces/0,
+ secret_set_value/1,
+ secret_set_value/0,
+ auth_sasl_step/1,
+ auth_sasl_step/0,
+ domain_migrate_finish/1,
+ domain_migrate_finish/0,
+ interface_undefine/1,
+ interface_undefine/0,
+ node_device_dump_xml/1,
+ node_device_dump_xml/0,
+ node_device_lookup_by_name/1,
+ node_device_lookup_by_name/0,
+ list_secrets/1,
+ list_secrets/0,
+ domain_memory_peek/1,
+ domain_memory_peek/0,
+ num_of_defined_domains/0,
+ node_list_devices/1,
+ node_list_devices/0,
+ domain_block_stats/1,
+ domain_block_stats/0,
+ domain_memory_stats/1,
+ domain_memory_stats/0,
+ num_of_storage_pools/0,
+ domain_save/1,
+ domain_save/0,
+ domain_migrate_prepare_tunnel/1,
+ domain_migrate_prepare_tunnel/0,
+ get_version/0,
+ domain_suspend/1,
+ domain_suspend/0,
+ network_set_autostart/1,
+ network_set_autostart/0,
+ domain_is_active/1,
+ domain_is_active/0,
+ network_get_autostart/1,
+ network_get_autostart/0,
+ node_device_create_xml/1,
+ node_device_create_xml/0,
+ auth_list/0,
+ list_defined_storage_pools/1,
+ list_defined_storage_pools/0,
+ domain_get_max_memory/1,
+ domain_get_max_memory/0,
+ num_of_domains/0,
+ list_networks/1,
+ list_networks/0,
+ storage_pool_undefine/1,
+ storage_pool_undefine/0,
+ domain_set_autostart/1,
+ domain_set_autostart/0,
+ storage_pool_get_autostart/1,
+ storage_pool_get_autostart/0,
+ domain_get_security_label/1,
+ domain_get_security_label/0,
+ storage_vol_get_path/1,
+ storage_vol_get_path/0,
+ get_uri/0,
+ close/0,
+ interface_is_active/1,
+ interface_is_active/0,
+ storage_pool_get_info/1,
+ storage_pool_get_info/0,
+ domain_restore/1,
+ domain_restore/0,
+ network_create/1,
+ network_create/0,
+ num_of_defined_networks/0,
+ storage_pool_define_xml/1,
+ storage_pool_define_xml/0,
+ network_lookup_by_uuid/1,
+ network_lookup_by_uuid/0,
+ storage_vol_get_info/1,
+ storage_vol_get_info/0,
+ domain_define_xml/1,
+ domain_define_xml/0,
+ storage_vol_dump_xml/1,
+ storage_vol_dump_xml/0,
+ interface_lookup_by_name/1,
+ interface_lookup_by_name/0,
+ node_device_destroy/1,
+ node_device_destroy/0,
+ get_max_vcpus/1,
+ get_max_vcpus/0,
+ domain_migrate_perform/1,
+ domain_migrate_perform/0,
+ node_device_get_parent/1,
+ node_device_get_parent/0,
+ list_defined_domains/1,
+ list_defined_domains/0,
+ get_capabilities/0,
+ secret_undefine/1,
+ secret_undefine/0,
+ domain_set_max_memory/1,
+ domain_set_max_memory/0,
+ interface_create/1,
+ interface_create/0,
+ domain_get_os_type/1,
+ domain_get_os_type/0,
+ domain_get_autostart/1,
+ domain_get_autostart/0,
+ domain_set_vcpus/1,
+ domain_set_vcpus/0,
+ node_get_security_model/0,
+ network_destroy/1,
+ network_destroy/0,
+ storage_pool_lookup_by_uuid/1,
+ storage_pool_lookup_by_uuid/0,
+ storage_vol_lookup_by_key/1,
+ storage_vol_lookup_by_key/0,
+ list_defined_networks/1,
+ list_defined_networks/0,
+ node_device_list_caps/1,
+ node_device_list_caps/0,
+ storage_pool_refresh/1,
+ storage_pool_refresh/0,
+ storage_vol_lookup_by_path/1,
+ storage_vol_lookup_by_path/0,
+ network_is_active/1,
+ network_is_active/0,
+ get_type/0,
+ domain_block_peek/1,
+ domain_block_peek/0,
+ is_secure/0,
+ domain_set_scheduler_parameters/1,
+ domain_set_scheduler_parameters/0,
+ storage_pool_is_persistent/1,
+ storage_pool_is_persistent/0,
+ storage_pool_create_xml/1,
+ storage_pool_create_xml/0,
+ storage_pool_build/1,
+ storage_pool_build/0,
+ storage_pool_lookup_by_volume/1,
+ storage_pool_lookup_by_volume/0,
+ domain_get_info/1,
+ domain_get_info/0,
+ node_device_num_of_caps/1,
+ node_device_num_of_caps/0,
+ storage_pool_num_of_volumes/1,
+ storage_pool_num_of_volumes/0,
+ domain_resume/1,
+ domain_resume/0,
+ domain_destroy/1,
+ domain_destroy/0,
+ network_get_bridge_name/1,
+ network_get_bridge_name/0,
+ find_storage_pool_sources/1,
+ find_storage_pool_sources/0,
+ node_num_of_devices/1,
+ node_num_of_devices/0,
+ domain_get_vcpus/1,
+ domain_get_vcpus/0,
+ domain_get_scheduler_parameters/1,
+ domain_get_scheduler_parameters/0,
+ num_of_secrets/0,
+ node_get_info/0,
+ node_device_reset/1,
+ node_device_reset/0,
+ network_lookup_by_name/1,
+ network_lookup_by_name/0,
+ node_device_dettach/1,
+ node_device_dettach/0,
+ domain_xml_from_native/1,
+ domain_xml_from_native/0,
+ domain_detach_device/1,
+ domain_detach_device/0,
+ domain_migrate_prepare/1,
+ domain_migrate_prepare/0,
+ domain_create_xml/1,
+ domain_create_xml/0,
+ domain_undefine/1,
+ domain_undefine/0,
+ domain_get_scheduler_type/1,
+ domain_get_scheduler_type/0,
+ node_get_cells_free_memory/1,
+ node_get_cells_free_memory/0,
+ network_is_persistent/1,
+ network_is_persistent/0,
+ storage_pool_lookup_by_name/1,
+ storage_pool_lookup_by_name/0,
+ secret_get_xml_desc/1,
+ secret_get_xml_desc/0,
+ storage_pool_create/1,
+ storage_pool_create/0,
+ num_of_defined_storage_pools/0,
+ domain_is_persistent/1,
+ domain_is_persistent/0,
+ domain_core_dump/1,
+ domain_core_dump/0,
+ get_lib_version/0,
+ domain_event/0,
+ domain_migrate_finish2/0,
+ node_get_free_memory/0,
+ domain_migrate_prepare2/0,
+ domain_attach_device/1,
+ domain_attach_device/0,
+ domain_lookup_by_id/1,
+ domain_lookup_by_id/0,
+ num_of_networks/0,
+ cpu_compare/1,
+ cpu_compare/0,
+ domain_xml_to_native/1,
+ domain_xml_to_native/0,
+ list_storage_pools/1,
+ list_storage_pools/0,
+ storage_vol_lookup_by_name/1,
+ storage_vol_lookup_by_name/0,
+ storage_pool_is_active/1,
+ storage_pool_is_active/0,
+ domain_dump_xml/1,
+ domain_dump_xml/0
+ ]).
+-include("verx.hrl").
+
+open(Struct) ->
+ verx_xdr:arg(Struct, open()).
+open() ->
+ [
+ {name, remote_string},
+ {flags, int}
+ ].
+
+supports_feature(Struct) ->
+ verx_xdr:arg(Struct, supports_feature()).
+supports_feature() ->
+ [
+ {feature, int}
+ ].
+
+get_max_vcpus(Struct) ->
+ verx_xdr:arg(Struct, get_max_vcpus()).
+get_max_vcpus() ->
+ [
+ {type, remote_string}
+ ].
+
+node_get_cells_free_memory(Struct) ->
+ verx_xdr:arg(Struct, node_get_cells_free_memory()).
+node_get_cells_free_memory() ->
+ [
+ {startCell, int},
+ {maxCells, int}
+ ].
+
+domain_get_scheduler_type(Struct) ->
+ verx_xdr:arg(Struct, domain_get_scheduler_type()).
+domain_get_scheduler_type() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_get_scheduler_parameters(Struct) ->
+ verx_xdr:arg(Struct, domain_get_scheduler_parameters()).
+domain_get_scheduler_parameters() ->
+ [
+ {dom, remote_nonnull_domain},
+ {nparams, int}
+ ].
+
+domain_set_scheduler_parameters(Struct) ->
+ verx_xdr:arg(Struct, domain_set_scheduler_parameters()).
+domain_set_scheduler_parameters() ->
+ [
+ {dom, remote_nonnull_domain},
+ {params, remote_sched_param}
+ ].
+
+domain_block_stats(Struct) ->
+ verx_xdr:arg(Struct, domain_block_stats()).
+domain_block_stats() ->
+ [
+ {dom, remote_nonnull_domain},
+ {path, remote_nonnull_string}
+ ].
+
+domain_interface_stats(Struct) ->
+ verx_xdr:arg(Struct, domain_interface_stats()).
+domain_interface_stats() ->
+ [
+ {dom, remote_nonnull_domain},
+ {path, remote_nonnull_string}
+ ].
+
+domain_memory_stats(Struct) ->
+ verx_xdr:arg(Struct, domain_memory_stats()).
+domain_memory_stats() ->
+ [
+ {dom, remote_nonnull_domain},
+ {maxStats, u_int},
+ {flags, u_int}
+ ].
+
+domain_block_peek(Struct) ->
+ verx_xdr:arg(Struct, domain_block_peek()).
+domain_block_peek() ->
+ [
+ {dom, remote_nonnull_domain},
+ {path, remote_nonnull_string},
+ {offset, uhyper},
+ {size, uint},
+ {flags, uint}
+ ].
+
+domain_memory_peek(Struct) ->
+ verx_xdr:arg(Struct, domain_memory_peek()).
+domain_memory_peek() ->
+ [
+ {dom, remote_nonnull_domain},
+ {offset, uhyper},
+ {size, uint},
+ {flags, uint}
+ ].
+
+list_domains(Struct) ->
+ verx_xdr:arg(Struct, list_domains()).
+list_domains() ->
+ [
+ {maxids, int}
+ ].
+
+domain_create_xml(Struct) ->
+ verx_xdr:arg(Struct, domain_create_xml()).
+domain_create_xml() ->
+ [
+ {xml_desc, remote_nonnull_string},
+ {flags, int}
+ ].
+
+domain_lookup_by_id(Struct) ->
+ verx_xdr:arg(Struct, domain_lookup_by_id()).
+domain_lookup_by_id() ->
+ [
+ {id, int}
+ ].
+
+domain_lookup_by_uuid(Struct) ->
+ verx_xdr:arg(Struct, domain_lookup_by_uuid()).
+domain_lookup_by_uuid() ->
+ [
+ {uuid, remote_uuid}
+ ].
+
+domain_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, domain_lookup_by_name()).
+domain_lookup_by_name() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+domain_suspend(Struct) ->
+ verx_xdr:arg(Struct, domain_suspend()).
+domain_suspend() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_resume(Struct) ->
+ verx_xdr:arg(Struct, domain_resume()).
+domain_resume() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_shutdown(Struct) ->
+ verx_xdr:arg(Struct, domain_shutdown()).
+domain_shutdown() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_reboot(Struct) ->
+ verx_xdr:arg(Struct, domain_reboot()).
+domain_reboot() ->
+ [
+ {dom, remote_nonnull_domain},
+ {flags, int}
+ ].
+
+domain_destroy(Struct) ->
+ verx_xdr:arg(Struct, domain_destroy()).
+domain_destroy() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_get_os_type(Struct) ->
+ verx_xdr:arg(Struct, domain_get_os_type()).
+domain_get_os_type() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_get_max_memory(Struct) ->
+ verx_xdr:arg(Struct, domain_get_max_memory()).
+domain_get_max_memory() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_set_max_memory(Struct) ->
+ verx_xdr:arg(Struct, domain_set_max_memory()).
+domain_set_max_memory() ->
+ [
+ {dom, remote_nonnull_domain},
+ {memory, uhyper}
+ ].
+
+domain_set_memory(Struct) ->
+ verx_xdr:arg(Struct, domain_set_memory()).
+domain_set_memory() ->
+ [
+ {dom, remote_nonnull_domain},
+ {memory, uhyper}
+ ].
+
+domain_get_info(Struct) ->
+ verx_xdr:arg(Struct, domain_get_info()).
+domain_get_info() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_save(Struct) ->
+ verx_xdr:arg(Struct, domain_save()).
+domain_save() ->
+ [
+ {dom, remote_nonnull_domain},
+ {to, remote_nonnull_string}
+ ].
+
+domain_restore(Struct) ->
+ verx_xdr:arg(Struct, domain_restore()).
+domain_restore() ->
+ [
+ {from, remote_nonnull_string}
+ ].
+
+domain_core_dump(Struct) ->
+ verx_xdr:arg(Struct, domain_core_dump()).
+domain_core_dump() ->
+ [
+ {dom, remote_nonnull_domain},
+ {to, remote_nonnull_string},
+ {flags, int}
+ ].
+
+domain_dump_xml(Struct) ->
+ verx_xdr:arg(Struct, domain_dump_xml()).
+domain_dump_xml() ->
+ [
+ {dom, remote_nonnull_domain},
+ {flags, int}
+ ].
+
+domain_migrate_prepare(Struct) ->
+ verx_xdr:arg(Struct, domain_migrate_prepare()).
+domain_migrate_prepare() ->
+ [
+ {uri_in, remote_string},
+ {flags, uhyper},
+ {dname, remote_string},
+ {resource, uhyper}
+ ].
+
+domain_migrate_perform(Struct) ->
+ verx_xdr:arg(Struct, domain_migrate_perform()).
+domain_migrate_perform() ->
+ [
+ {dom, remote_nonnull_domain},
+ {cookie, opaque},
+ {uri, remote_nonnull_string},
+ {flags, uhyper},
+ {dname, remote_string},
+ {resource, uhyper}
+ ].
+
+domain_migrate_finish(Struct) ->
+ verx_xdr:arg(Struct, domain_migrate_finish()).
+domain_migrate_finish() ->
+ [
+ {dname, remote_nonnull_string},
+ {cookie, opaque},
+ {uri, remote_nonnull_string},
+ {flags, uhyper}
+ ].
+
+list_defined_domains(Struct) ->
+ verx_xdr:arg(Struct, list_defined_domains()).
+list_defined_domains() ->
+ [
+ {maxnames, int}
+ ].
+
+domain_create(Struct) ->
+ verx_xdr:arg(Struct, domain_create()).
+domain_create() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_define_xml(Struct) ->
+ verx_xdr:arg(Struct, domain_define_xml()).
+domain_define_xml() ->
+ [
+ {xml, remote_nonnull_string}
+ ].
+
+domain_undefine(Struct) ->
+ verx_xdr:arg(Struct, domain_undefine()).
+domain_undefine() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_set_vcpus(Struct) ->
+ verx_xdr:arg(Struct, domain_set_vcpus()).
+domain_set_vcpus() ->
+ [
+ {dom, remote_nonnull_domain},
+ {nvcpus, int}
+ ].
+
+domain_pin_vcpu(Struct) ->
+ verx_xdr:arg(Struct, domain_pin_vcpu()).
+domain_pin_vcpu() ->
+ [
+ {dom, remote_nonnull_domain},
+ {vcpu, int},
+ {cpumap, opaque}
+ ].
+
+domain_get_vcpus(Struct) ->
+ verx_xdr:arg(Struct, domain_get_vcpus()).
+domain_get_vcpus() ->
+ [
+ {dom, remote_nonnull_domain},
+ {maxinfo, int},
+ {maplen, int}
+ ].
+
+domain_get_max_vcpus(Struct) ->
+ verx_xdr:arg(Struct, domain_get_max_vcpus()).
+domain_get_max_vcpus() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_get_security_label(Struct) ->
+ verx_xdr:arg(Struct, domain_get_security_label()).
+domain_get_security_label() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_attach_device(Struct) ->
+ verx_xdr:arg(Struct, domain_attach_device()).
+domain_attach_device() ->
+ [
+ {dom, remote_nonnull_domain},
+ {xml, remote_nonnull_string}
+ ].
+
+domain_detach_device(Struct) ->
+ verx_xdr:arg(Struct, domain_detach_device()).
+domain_detach_device() ->
+ [
+ {dom, remote_nonnull_domain},
+ {xml, remote_nonnull_string}
+ ].
+
+domain_get_autostart(Struct) ->
+ verx_xdr:arg(Struct, domain_get_autostart()).
+domain_get_autostart() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_set_autostart(Struct) ->
+ verx_xdr:arg(Struct, domain_set_autostart()).
+domain_set_autostart() ->
+ [
+ {dom, remote_nonnull_domain},
+ {autostart, int}
+ ].
+
+list_networks(Struct) ->
+ verx_xdr:arg(Struct, list_networks()).
+list_networks() ->
+ [
+ {maxnames, int}
+ ].
+
+list_defined_networks(Struct) ->
+ verx_xdr:arg(Struct, list_defined_networks()).
+list_defined_networks() ->
+ [
+ {maxnames, int}
+ ].
+
+network_lookup_by_uuid(Struct) ->
+ verx_xdr:arg(Struct, network_lookup_by_uuid()).
+network_lookup_by_uuid() ->
+ [
+ {uuid, remote_uuid}
+ ].
+
+network_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, network_lookup_by_name()).
+network_lookup_by_name() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+network_create_xml(Struct) ->
+ verx_xdr:arg(Struct, network_create_xml()).
+network_create_xml() ->
+ [
+ {xml, remote_nonnull_string}
+ ].
+
+network_define_xml(Struct) ->
+ verx_xdr:arg(Struct, network_define_xml()).
+network_define_xml() ->
+ [
+ {xml, remote_nonnull_string}
+ ].
+
+network_undefine(Struct) ->
+ verx_xdr:arg(Struct, network_undefine()).
+network_undefine() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_create(Struct) ->
+ verx_xdr:arg(Struct, network_create()).
+network_create() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_destroy(Struct) ->
+ verx_xdr:arg(Struct, network_destroy()).
+network_destroy() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_dump_xml(Struct) ->
+ verx_xdr:arg(Struct, network_dump_xml()).
+network_dump_xml() ->
+ [
+ {net, remote_nonnull_network},
+ {flags, int}
+ ].
+
+network_get_bridge_name(Struct) ->
+ verx_xdr:arg(Struct, network_get_bridge_name()).
+network_get_bridge_name() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_get_autostart(Struct) ->
+ verx_xdr:arg(Struct, network_get_autostart()).
+network_get_autostart() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_set_autostart(Struct) ->
+ verx_xdr:arg(Struct, network_set_autostart()).
+network_set_autostart() ->
+ [
+ {net, remote_nonnull_network},
+ {autostart, int}
+ ].
+
+list_interfaces(Struct) ->
+ verx_xdr:arg(Struct, list_interfaces()).
+list_interfaces() ->
+ [
+ {maxnames, int}
+ ].
+
+list_defined_interfaces(Struct) ->
+ verx_xdr:arg(Struct, list_defined_interfaces()).
+list_defined_interfaces() ->
+ [
+ {maxnames, int}
+ ].
+
+interface_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, interface_lookup_by_name()).
+interface_lookup_by_name() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+interface_lookup_by_mac_string(Struct) ->
+ verx_xdr:arg(Struct, interface_lookup_by_mac_string()).
+interface_lookup_by_mac_string() ->
+ [
+ {mac, remote_nonnull_string}
+ ].
+
+interface_get_xml_desc(Struct) ->
+ verx_xdr:arg(Struct, interface_get_xml_desc()).
+interface_get_xml_desc() ->
+ [
+ {iface, remote_nonnull_interface},
+ {flags, uint}
+ ].
+
+interface_define_xml(Struct) ->
+ verx_xdr:arg(Struct, interface_define_xml()).
+interface_define_xml() ->
+ [
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+interface_undefine(Struct) ->
+ verx_xdr:arg(Struct, interface_undefine()).
+interface_undefine() ->
+ [
+ {iface, remote_nonnull_interface}
+ ].
+
+interface_create(Struct) ->
+ verx_xdr:arg(Struct, interface_create()).
+interface_create() ->
+ [
+ {iface, remote_nonnull_interface},
+ {flags, uint}
+ ].
+
+interface_destroy(Struct) ->
+ verx_xdr:arg(Struct, interface_destroy()).
+interface_destroy() ->
+ [
+ {iface, remote_nonnull_interface},
+ {flags, uint}
+ ].
+
+auth_sasl_start(Struct) ->
+ verx_xdr:arg(Struct, auth_sasl_start()).
+auth_sasl_start() ->
+ [
+ {mech, remote_nonnull_string},
+ {nil, int},
+ {data, char}
+ ].
+
+auth_sasl_step(Struct) ->
+ verx_xdr:arg(Struct, auth_sasl_step()).
+auth_sasl_step() ->
+ [
+ {nil, int},
+ {data, char}
+ ].
+
+list_storage_pools(Struct) ->
+ verx_xdr:arg(Struct, list_storage_pools()).
+list_storage_pools() ->
+ [
+ {maxnames, int}
+ ].
+
+list_defined_storage_pools(Struct) ->
+ verx_xdr:arg(Struct, list_defined_storage_pools()).
+list_defined_storage_pools() ->
+ [
+ {maxnames, int}
+ ].
+
+find_storage_pool_sources(Struct) ->
+ verx_xdr:arg(Struct, find_storage_pool_sources()).
+find_storage_pool_sources() ->
+ [
+ {type, remote_nonnull_string},
+ {srcSpec, remote_string},
+ {flags, uint}
+ ].
+
+storage_pool_lookup_by_uuid(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_lookup_by_uuid()).
+storage_pool_lookup_by_uuid() ->
+ [
+ {uuid, remote_uuid}
+ ].
+
+storage_pool_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_lookup_by_name()).
+storage_pool_lookup_by_name() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+storage_pool_lookup_by_volume(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_lookup_by_volume()).
+storage_pool_lookup_by_volume() ->
+ [
+ {vol, remote_nonnull_storage_vol}
+ ].
+
+storage_pool_create_xml(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_create_xml()).
+storage_pool_create_xml() ->
+ [
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+storage_pool_define_xml(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_define_xml()).
+storage_pool_define_xml() ->
+ [
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+storage_pool_build(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_build()).
+storage_pool_build() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {flags, uint}
+ ].
+
+storage_pool_undefine(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_undefine()).
+storage_pool_undefine() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_create(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_create()).
+storage_pool_create() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {flags, uint}
+ ].
+
+storage_pool_destroy(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_destroy()).
+storage_pool_destroy() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_delete(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_delete()).
+storage_pool_delete() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {flags, uint}
+ ].
+
+storage_pool_refresh(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_refresh()).
+storage_pool_refresh() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {flags, uint}
+ ].
+
+storage_pool_dump_xml(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_dump_xml()).
+storage_pool_dump_xml() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {flags, uint}
+ ].
+
+storage_pool_get_info(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_get_info()).
+storage_pool_get_info() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_get_autostart(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_get_autostart()).
+storage_pool_get_autostart() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_set_autostart(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_set_autostart()).
+storage_pool_set_autostart() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {autostart, int}
+ ].
+
+storage_pool_num_of_volumes(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_num_of_volumes()).
+storage_pool_num_of_volumes() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_list_volumes(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_list_volumes()).
+storage_pool_list_volumes() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {maxnames, int}
+ ].
+
+storage_vol_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_lookup_by_name()).
+storage_vol_lookup_by_name() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {name, remote_nonnull_string}
+ ].
+
+storage_vol_lookup_by_key(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_lookup_by_key()).
+storage_vol_lookup_by_key() ->
+ [
+ {key, remote_nonnull_string}
+ ].
+
+storage_vol_lookup_by_path(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_lookup_by_path()).
+storage_vol_lookup_by_path() ->
+ [
+ {path, remote_nonnull_string}
+ ].
+
+storage_vol_create_xml(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_create_xml()).
+storage_vol_create_xml() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+storage_vol_create_xml_from(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_create_xml_from()).
+storage_vol_create_xml_from() ->
+ [
+ {pool, remote_nonnull_storage_pool},
+ {xml, remote_nonnull_string},
+ {clonevol, remote_nonnull_storage_vol},
+ {flags, uint}
+ ].
+
+storage_vol_delete(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_delete()).
+storage_vol_delete() ->
+ [
+ {vol, remote_nonnull_storage_vol},
+ {flags, uint}
+ ].
+
+storage_vol_dump_xml(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_dump_xml()).
+storage_vol_dump_xml() ->
+ [
+ {vol, remote_nonnull_storage_vol},
+ {flags, uint}
+ ].
+
+storage_vol_get_info(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_get_info()).
+storage_vol_get_info() ->
+ [
+ {vol, remote_nonnull_storage_vol}
+ ].
+
+storage_vol_get_path(Struct) ->
+ verx_xdr:arg(Struct, storage_vol_get_path()).
+storage_vol_get_path() ->
+ [
+ {vol, remote_nonnull_storage_vol}
+ ].
+
+node_num_of_devices(Struct) ->
+ verx_xdr:arg(Struct, node_num_of_devices()).
+node_num_of_devices() ->
+ [
+ {cap, remote_string},
+ {flags, uint}
+ ].
+
+node_list_devices(Struct) ->
+ verx_xdr:arg(Struct, node_list_devices()).
+node_list_devices() ->
+ [
+ {cap, remote_string},
+ {maxnames, int},
+ {flags, uint}
+ ].
+
+node_device_lookup_by_name(Struct) ->
+ verx_xdr:arg(Struct, node_device_lookup_by_name()).
+node_device_lookup_by_name() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_dump_xml(Struct) ->
+ verx_xdr:arg(Struct, node_device_dump_xml()).
+node_device_dump_xml() ->
+ [
+ {name, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+node_device_get_parent(Struct) ->
+ verx_xdr:arg(Struct, node_device_get_parent()).
+node_device_get_parent() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_num_of_caps(Struct) ->
+ verx_xdr:arg(Struct, node_device_num_of_caps()).
+node_device_num_of_caps() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_list_caps(Struct) ->
+ verx_xdr:arg(Struct, node_device_list_caps()).
+node_device_list_caps() ->
+ [
+ {name, remote_nonnull_string},
+ {maxnames, int}
+ ].
+
+node_device_dettach(Struct) ->
+ verx_xdr:arg(Struct, node_device_dettach()).
+node_device_dettach() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_re_attach(Struct) ->
+ verx_xdr:arg(Struct, node_device_re_attach()).
+node_device_re_attach() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_reset(Struct) ->
+ verx_xdr:arg(Struct, node_device_reset()).
+node_device_reset() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+node_device_create_xml(Struct) ->
+ verx_xdr:arg(Struct, node_device_create_xml()).
+node_device_create_xml() ->
+ [
+ {xml_desc, remote_nonnull_string},
+ {flags, int}
+ ].
+
+node_device_destroy(Struct) ->
+ verx_xdr:arg(Struct, node_device_destroy()).
+node_device_destroy() ->
+ [
+ {name, remote_nonnull_string}
+ ].
+
+domain_xml_from_native(Struct) ->
+ verx_xdr:arg(Struct, domain_xml_from_native()).
+domain_xml_from_native() ->
+ [
+ {nativeFormat, remote_nonnull_string},
+ {nativeConfig, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+domain_xml_to_native(Struct) ->
+ verx_xdr:arg(Struct, domain_xml_to_native()).
+domain_xml_to_native() ->
+ [
+ {nativeFormat, remote_nonnull_string},
+ {domainXml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+list_secrets(Struct) ->
+ verx_xdr:arg(Struct, list_secrets()).
+list_secrets() ->
+ [
+ {maxuuids, int}
+ ].
+
+secret_lookup_by_uuid(Struct) ->
+ verx_xdr:arg(Struct, secret_lookup_by_uuid()).
+secret_lookup_by_uuid() ->
+ [
+ {uuid, remote_uuid}
+ ].
+
+secret_define_xml(Struct) ->
+ verx_xdr:arg(Struct, secret_define_xml()).
+secret_define_xml() ->
+ [
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+secret_get_xml_desc(Struct) ->
+ verx_xdr:arg(Struct, secret_get_xml_desc()).
+secret_get_xml_desc() ->
+ [
+ {secret, remote_nonnull_secret},
+ {flags, uint}
+ ].
+
+secret_set_value(Struct) ->
+ verx_xdr:arg(Struct, secret_set_value()).
+secret_set_value() ->
+ [
+ {secret, remote_nonnull_secret},
+ {value, opaque},
+ {flags, uint}
+ ].
+
+secret_get_value(Struct) ->
+ verx_xdr:arg(Struct, secret_get_value()).
+secret_get_value() ->
+ [
+ {secret, remote_nonnull_secret},
+ {flags, uint}
+ ].
+
+secret_undefine(Struct) ->
+ verx_xdr:arg(Struct, secret_undefine()).
+secret_undefine() ->
+ [
+ {secret, remote_nonnull_secret}
+ ].
+
+secret_lookup_by_usage(Struct) ->
+ verx_xdr:arg(Struct, secret_lookup_by_usage()).
+secret_lookup_by_usage() ->
+ [
+ {usageType, int},
+ {usageID, remote_nonnull_string}
+ ].
+
+domain_migrate_prepare_tunnel(Struct) ->
+ verx_xdr:arg(Struct, domain_migrate_prepare_tunnel()).
+domain_migrate_prepare_tunnel() ->
+ [
+ {flags, uhyper},
+ {dname, remote_string},
+ {resource, uhyper},
+ {dom_xml, remote_nonnull_string}
+ ].
+
+domain_is_active(Struct) ->
+ verx_xdr:arg(Struct, domain_is_active()).
+domain_is_active() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+domain_is_persistent(Struct) ->
+ verx_xdr:arg(Struct, domain_is_persistent()).
+domain_is_persistent() ->
+ [
+ {dom, remote_nonnull_domain}
+ ].
+
+network_is_active(Struct) ->
+ verx_xdr:arg(Struct, network_is_active()).
+network_is_active() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+network_is_persistent(Struct) ->
+ verx_xdr:arg(Struct, network_is_persistent()).
+network_is_persistent() ->
+ [
+ {net, remote_nonnull_network}
+ ].
+
+storage_pool_is_active(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_is_active()).
+storage_pool_is_active() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+storage_pool_is_persistent(Struct) ->
+ verx_xdr:arg(Struct, storage_pool_is_persistent()).
+storage_pool_is_persistent() ->
+ [
+ {pool, remote_nonnull_storage_pool}
+ ].
+
+interface_is_active(Struct) ->
+ verx_xdr:arg(Struct, interface_is_active()).
+interface_is_active() ->
+ [
+ {iface, remote_nonnull_interface}
+ ].
+
+cpu_compare(Struct) ->
+ verx_xdr:arg(Struct, cpu_compare()).
+cpu_compare() ->
+ [
+ {xml, remote_nonnull_string},
+ {flags, uint}
+ ].
+
+
+domain_events_deregister() -> [].
+auth_sasl_init() -> [].
+get_hostname() -> [].
+num_of_defined_interfaces() -> [].
+domain_events_register() -> [].
+num_of_interfaces() -> [].
+auth_polkit() -> [].
+num_of_defined_domains() -> [].
+num_of_storage_pools() -> [].
+get_version() -> [].
+auth_list() -> [].
+num_of_domains() -> [].
+get_uri() -> [].
+close() -> [].
+num_of_defined_networks() -> [].
+get_capabilities() -> [].
+node_get_security_model() -> [].
+get_type() -> [].
+is_secure() -> [].
+num_of_secrets() -> [].
+node_get_info() -> [].
+num_of_defined_storage_pools() -> [].
+get_lib_version() -> [].
+domain_event() -> [].
+domain_migrate_finish2() -> [].
+node_get_free_memory() -> [].
+domain_migrate_prepare2() -> [].
+num_of_networks() -> [].
375 src/verx_constant.erl
@@ -0,0 +1,375 @@
+%% Copyright (c) 2011, Michael Santos <michael.santos@gmail.com>
+%% All rights reserved.
+%%
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions
+%% are met:
+%%
+%% Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in the
+%% documentation and/or other materials provided with the distribution.
+%%
+%% Neither the name of the author nor the names of its contributors
+%% may be used to endorse or promote products derived from this software
+%% without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGE.
+-module(verx_constant).
+-export([proc/1,type/1,status/1]).
+-include("verx.hrl").
+
+proc(?REMOTE_PROC_OPEN) -> open;
+proc(open) -> ?REMOTE_PROC_OPEN;
+proc(?REMOTE_PROC_CLOSE) -> close;
+proc(close) -> ?REMOTE_PROC_CLOSE;
+proc(?REMOTE_PROC_GET_TYPE) -> get_type;
+proc(get_type) -> ?REMOTE_PROC_GET_TYPE;
+proc(?REMOTE_PROC_GET_VERSION) -> get_version;
+proc(get_version) -> ?REMOTE_PROC_GET_VERSION;
+proc(?REMOTE_PROC_GET_MAX_VCPUS) -> get_max_vcpus;
+proc(get_max_vcpus) -> ?REMOTE_PROC_GET_MAX_VCPUS;
+proc(?REMOTE_PROC_NODE_GET_INFO) -> node_get_info;
+proc(node_get_info) -> ?REMOTE_PROC_NODE_GET_INFO;
+proc(?REMOTE_PROC_GET_CAPABILITIES) -> get_capabilities;
+proc(get_capabilities) -> ?REMOTE_PROC_GET_CAPABILITIES;
+proc(?REMOTE_PROC_DOMAIN_ATTACH_DEVICE) -> domain_attach_device;
+proc(domain_attach_device) -> ?REMOTE_PROC_DOMAIN_ATTACH_DEVICE;
+proc(?REMOTE_PROC_DOMAIN_CREATE) -> domain_create;
+proc(domain_create) -> ?REMOTE_PROC_DOMAIN_CREATE;
+proc(?REMOTE_PROC_DOMAIN_CREATE_XML) -> domain_create_xml;
+proc(domain_create_xml) -> ?REMOTE_PROC_DOMAIN_CREATE_XML;
+proc(?REMOTE_PROC_DOMAIN_DEFINE_XML) -> domain_define_xml;
+proc(domain_define_xml) -> ?REMOTE_PROC_DOMAIN_DEFINE_XML;
+proc(?REMOTE_PROC_DOMAIN_DESTROY) -> domain_destroy;
+proc(domain_destroy) -> ?REMOTE_PROC_DOMAIN_DESTROY;
+proc(?REMOTE_PROC_DOMAIN_DETACH_DEVICE) -> domain_detach_device;
+proc(domain_detach_device) -> ?REMOTE_PROC_DOMAIN_DETACH_DEVICE;
+proc(?REMOTE_PROC_DOMAIN_DUMP_XML) -> domain_dump_xml;
+proc(domain_dump_xml) -> ?REMOTE_PROC_DOMAIN_DUMP_XML;
+proc(?REMOTE_PROC_DOMAIN_GET_AUTOSTART) -> domain_get_autostart;
+proc(domain_get_autostart) -> ?REMOTE_PROC_DOMAIN_GET_AUTOSTART;
+proc(?REMOTE_PROC_DOMAIN_GET_INFO) -> domain_get_info;
+proc(domain_get_info) -> ?REMOTE_PROC_DOMAIN_GET_INFO;
+proc(?REMOTE_PROC_DOMAIN_GET_MAX_MEMORY) -> domain_get_max_memory;
+proc(domain_get_max_memory) -> ?REMOTE_PROC_DOMAIN_GET_MAX_MEMORY;
+proc(?REMOTE_PROC_DOMAIN_GET_MAX_VCPUS) -> domain_get_max_vcpus;
+proc(domain_get_max_vcpus) -> ?REMOTE_PROC_DOMAIN_GET_MAX_VCPUS;
+proc(?REMOTE_PROC_DOMAIN_GET_OS_TYPE) -> domain_get_os_type;
+proc(domain_get_os_type) -> ?REMOTE_PROC_DOMAIN_GET_OS_TYPE;
+proc(?REMOTE_PROC_DOMAIN_GET_VCPUS) -> domain_get_vcpus;
+proc(domain_get_vcpus) -> ?REMOTE_PROC_DOMAIN_GET_VCPUS;
+proc(?REMOTE_PROC_LIST_DEFINED_DOMAINS) -> list_defined_domains;
+proc(list_defined_domains) -> ?REMOTE_PROC_LIST_DEFINED_DOMAINS;
+proc(?REMOTE_PROC_DOMAIN_LOOKUP_BY_ID) -> domain_lookup_by_id;
+proc(domain_lookup_by_id) -> ?REMOTE_PROC_DOMAIN_LOOKUP_BY_ID;
+proc(?REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME) -> domain_lookup_by_name;
+proc(domain_lookup_by_name) -> ?REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID) -> domain_lookup_by_uuid;
+proc(domain_lookup_by_uuid) -> ?REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID;
+proc(?REMOTE_PROC_NUM_OF_DEFINED_DOMAINS) -> num_of_defined_domains;
+proc(num_of_defined_domains) -> ?REMOTE_PROC_NUM_OF_DEFINED_DOMAINS;
+proc(?REMOTE_PROC_DOMAIN_PIN_VCPU) -> domain_pin_vcpu;
+proc(domain_pin_vcpu) -> ?REMOTE_PROC_DOMAIN_PIN_VCPU;
+proc(?REMOTE_PROC_DOMAIN_REBOOT) -> domain_reboot;
+proc(domain_reboot) -> ?REMOTE_PROC_DOMAIN_REBOOT;
+proc(?REMOTE_PROC_DOMAIN_RESUME) -> domain_resume;
+proc(domain_resume) -> ?REMOTE_PROC_DOMAIN_RESUME;
+proc(?REMOTE_PROC_DOMAIN_SET_AUTOSTART) -> domain_set_autostart;
+proc(domain_set_autostart) -> ?REMOTE_PROC_DOMAIN_SET_AUTOSTART;
+proc(?REMOTE_PROC_DOMAIN_SET_MAX_MEMORY) -> domain_set_max_memory;
+proc(domain_set_max_memory) -> ?REMOTE_PROC_DOMAIN_SET_MAX_MEMORY;
+proc(?REMOTE_PROC_DOMAIN_SET_MEMORY) -> domain_set_memory;
+proc(domain_set_memory) -> ?REMOTE_PROC_DOMAIN_SET_MEMORY;
+proc(?REMOTE_PROC_DOMAIN_SET_VCPUS) -> domain_set_vcpus;
+proc(domain_set_vcpus) -> ?REMOTE_PROC_DOMAIN_SET_VCPUS;
+proc(?REMOTE_PROC_DOMAIN_SHUTDOWN) -> domain_shutdown;
+proc(domain_shutdown) -> ?REMOTE_PROC_DOMAIN_SHUTDOWN;
+proc(?REMOTE_PROC_DOMAIN_SUSPEND) -> domain_suspend;
+proc(domain_suspend) -> ?REMOTE_PROC_DOMAIN_SUSPEND;
+proc(?REMOTE_PROC_DOMAIN_UNDEFINE) -> domain_undefine;
+proc(domain_undefine) -> ?REMOTE_PROC_DOMAIN_UNDEFINE;
+proc(?REMOTE_PROC_LIST_DEFINED_NETWORKS) -> list_defined_networks;
+proc(list_defined_networks) -> ?REMOTE_PROC_LIST_DEFINED_NETWORKS;
+proc(?REMOTE_PROC_LIST_DOMAINS) -> list_domains;
+proc(list_domains) -> ?REMOTE_PROC_LIST_DOMAINS;
+proc(?REMOTE_PROC_LIST_NETWORKS) -> list_networks;
+proc(list_networks) -> ?REMOTE_PROC_LIST_NETWORKS;
+proc(?REMOTE_PROC_NETWORK_CREATE) -> network_create;
+proc(network_create) -> ?REMOTE_PROC_NETWORK_CREATE;
+proc(?REMOTE_PROC_NETWORK_CREATE_XML) -> network_create_xml;
+proc(network_create_xml) -> ?REMOTE_PROC_NETWORK_CREATE_XML;
+proc(?REMOTE_PROC_NETWORK_DEFINE_XML) -> network_define_xml;
+proc(network_define_xml) -> ?REMOTE_PROC_NETWORK_DEFINE_XML;
+proc(?REMOTE_PROC_NETWORK_DESTROY) -> network_destroy;
+proc(network_destroy) -> ?REMOTE_PROC_NETWORK_DESTROY;
+proc(?REMOTE_PROC_NETWORK_DUMP_XML) -> network_dump_xml;
+proc(network_dump_xml) -> ?REMOTE_PROC_NETWORK_DUMP_XML;
+proc(?REMOTE_PROC_NETWORK_GET_AUTOSTART) -> network_get_autostart;
+proc(network_get_autostart) -> ?REMOTE_PROC_NETWORK_GET_AUTOSTART;
+proc(?REMOTE_PROC_NETWORK_GET_BRIDGE_NAME) -> network_get_bridge_name;
+proc(network_get_bridge_name) -> ?REMOTE_PROC_NETWORK_GET_BRIDGE_NAME;
+proc(?REMOTE_PROC_NETWORK_LOOKUP_BY_NAME) -> network_lookup_by_name;
+proc(network_lookup_by_name) -> ?REMOTE_PROC_NETWORK_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_NETWORK_LOOKUP_BY_UUID) -> network_lookup_by_uuid;
+proc(network_lookup_by_uuid) -> ?REMOTE_PROC_NETWORK_LOOKUP_BY_UUID;
+proc(?REMOTE_PROC_NETWORK_SET_AUTOSTART) -> network_set_autostart;
+proc(network_set_autostart) -> ?REMOTE_PROC_NETWORK_SET_AUTOSTART;
+proc(?REMOTE_PROC_NETWORK_UNDEFINE) -> network_undefine;
+proc(network_undefine) -> ?REMOTE_PROC_NETWORK_UNDEFINE;
+proc(?REMOTE_PROC_NUM_OF_DEFINED_NETWORKS) -> num_of_defined_networks;
+proc(num_of_defined_networks) -> ?REMOTE_PROC_NUM_OF_DEFINED_NETWORKS;
+proc(?REMOTE_PROC_NUM_OF_DOMAINS) -> num_of_domains;
+proc(num_of_domains) -> ?REMOTE_PROC_NUM_OF_DOMAINS;
+proc(?REMOTE_PROC_NUM_OF_NETWORKS) -> num_of_networks;
+proc(num_of_networks) -> ?REMOTE_PROC_NUM_OF_NETWORKS;
+proc(?REMOTE_PROC_DOMAIN_CORE_DUMP) -> domain_core_dump;
+proc(domain_core_dump) -> ?REMOTE_PROC_DOMAIN_CORE_DUMP;
+proc(?REMOTE_PROC_DOMAIN_RESTORE) -> domain_restore;
+proc(domain_restore) -> ?REMOTE_PROC_DOMAIN_RESTORE;
+proc(?REMOTE_PROC_DOMAIN_SAVE) -> domain_save;
+proc(domain_save) -> ?REMOTE_PROC_DOMAIN_SAVE;
+proc(?REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE) -> domain_get_scheduler_type;
+proc(domain_get_scheduler_type) -> ?REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE;
+proc(?REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS) -> domain_get_scheduler_parameters;
+proc(domain_get_scheduler_parameters) -> ?REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS;
+proc(?REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS) -> domain_set_scheduler_parameters;
+proc(domain_set_scheduler_parameters) -> ?REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS;
+proc(?REMOTE_PROC_GET_HOSTNAME) -> get_hostname;
+proc(get_hostname) -> ?REMOTE_PROC_GET_HOSTNAME;
+proc(?REMOTE_PROC_SUPPORTS_FEATURE) -> supports_feature;
+proc(supports_feature) -> ?REMOTE_PROC_SUPPORTS_FEATURE;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE) -> domain_migrate_prepare;
+proc(domain_migrate_prepare) -> ?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_PERFORM) -> domain_migrate_perform;
+proc(domain_migrate_perform) -> ?REMOTE_PROC_DOMAIN_MIGRATE_PERFORM;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_FINISH) -> domain_migrate_finish;
+proc(domain_migrate_finish) -> ?REMOTE_PROC_DOMAIN_MIGRATE_FINISH;
+proc(?REMOTE_PROC_DOMAIN_BLOCK_STATS) -> domain_block_stats;
+proc(domain_block_stats) -> ?REMOTE_PROC_DOMAIN_BLOCK_STATS;
+proc(?REMOTE_PROC_DOMAIN_INTERFACE_STATS) -> domain_interface_stats;
+proc(domain_interface_stats) -> ?REMOTE_PROC_DOMAIN_INTERFACE_STATS;
+proc(?REMOTE_PROC_AUTH_LIST) -> auth_list;
+proc(auth_list) -> ?REMOTE_PROC_AUTH_LIST;
+proc(?REMOTE_PROC_AUTH_SASL_INIT) -> auth_sasl_init;
+proc(auth_sasl_init) -> ?REMOTE_PROC_AUTH_SASL_INIT;
+proc(?REMOTE_PROC_AUTH_SASL_START) -> auth_sasl_start;
+proc(auth_sasl_start) -> ?REMOTE_PROC_AUTH_SASL_START;
+proc(?REMOTE_PROC_AUTH_SASL_STEP) -> auth_sasl_step;
+proc(auth_sasl_step) -> ?REMOTE_PROC_AUTH_SASL_STEP;
+proc(?REMOTE_PROC_AUTH_POLKIT) -> auth_polkit;
+proc(auth_polkit) -> ?REMOTE_PROC_AUTH_POLKIT;
+proc(?REMOTE_PROC_NUM_OF_STORAGE_POOLS) -> num_of_storage_pools;
+proc(num_of_storage_pools) -> ?REMOTE_PROC_NUM_OF_STORAGE_POOLS;
+proc(?REMOTE_PROC_LIST_STORAGE_POOLS) -> list_storage_pools;
+proc(list_storage_pools) -> ?REMOTE_PROC_LIST_STORAGE_POOLS;
+proc(?REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS) -> num_of_defined_storage_pools;
+proc(num_of_defined_storage_pools) -> ?REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS;
+proc(?REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS) -> list_defined_storage_pools;
+proc(list_defined_storage_pools) -> ?REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS;
+proc(?REMOTE_PROC_FIND_STORAGE_POOL_SOURCES) -> find_storage_pool_sources;
+proc(find_storage_pool_sources) -> ?REMOTE_PROC_FIND_STORAGE_POOL_SOURCES;
+proc(?REMOTE_PROC_STORAGE_POOL_CREATE_XML) -> storage_pool_create_xml;
+proc(storage_pool_create_xml) -> ?REMOTE_PROC_STORAGE_POOL_CREATE_XML;
+proc(?REMOTE_PROC_STORAGE_POOL_DEFINE_XML) -> storage_pool_define_xml;
+proc(storage_pool_define_xml) -> ?REMOTE_PROC_STORAGE_POOL_DEFINE_XML;
+proc(?REMOTE_PROC_STORAGE_POOL_CREATE) -> storage_pool_create;
+proc(storage_pool_create) -> ?REMOTE_PROC_STORAGE_POOL_CREATE;
+proc(?REMOTE_PROC_STORAGE_POOL_BUILD) -> storage_pool_build;
+proc(storage_pool_build) -> ?REMOTE_PROC_STORAGE_POOL_BUILD;
+proc(?REMOTE_PROC_STORAGE_POOL_DESTROY) -> storage_pool_destroy;
+proc(storage_pool_destroy) -> ?REMOTE_PROC_STORAGE_POOL_DESTROY;
+proc(?REMOTE_PROC_STORAGE_POOL_DELETE) -> storage_pool_delete;
+proc(storage_pool_delete) -> ?REMOTE_PROC_STORAGE_POOL_DELETE;
+proc(?REMOTE_PROC_STORAGE_POOL_UNDEFINE) -> storage_pool_undefine;
+proc(storage_pool_undefine) -> ?REMOTE_PROC_STORAGE_POOL_UNDEFINE;
+proc(?REMOTE_PROC_STORAGE_POOL_REFRESH) -> storage_pool_refresh;
+proc(storage_pool_refresh) -> ?REMOTE_PROC_STORAGE_POOL_REFRESH;
+proc(?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME) -> storage_pool_lookup_by_name;
+proc(storage_pool_lookup_by_name) -> ?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID) -> storage_pool_lookup_by_uuid;
+proc(storage_pool_lookup_by_uuid) -> ?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID;
+proc(?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME) -> storage_pool_lookup_by_volume;
+proc(storage_pool_lookup_by_volume) -> ?REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME;
+proc(?REMOTE_PROC_STORAGE_POOL_GET_INFO) -> storage_pool_get_info;
+proc(storage_pool_get_info) -> ?REMOTE_PROC_STORAGE_POOL_GET_INFO;
+proc(?REMOTE_PROC_STORAGE_POOL_DUMP_XML) -> storage_pool_dump_xml;
+proc(storage_pool_dump_xml) -> ?REMOTE_PROC_STORAGE_POOL_DUMP_XML;
+proc(?REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART) -> storage_pool_get_autostart;
+proc(storage_pool_get_autostart) -> ?REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART;
+proc(?REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART) -> storage_pool_set_autostart;
+proc(storage_pool_set_autostart) -> ?REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART;
+proc(?REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES) -> storage_pool_num_of_volumes;
+proc(storage_pool_num_of_volumes) -> ?REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES;
+proc(?REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES) -> storage_pool_list_volumes;
+proc(storage_pool_list_volumes) -> ?REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES;
+proc(?REMOTE_PROC_STORAGE_VOL_CREATE_XML) -> storage_vol_create_xml;
+proc(storage_vol_create_xml) -> ?REMOTE_PROC_STORAGE_VOL_CREATE_XML;
+proc(?REMOTE_PROC_STORAGE_VOL_DELETE) -> storage_vol_delete;
+proc(storage_vol_delete) -> ?REMOTE_PROC_STORAGE_VOL_DELETE;
+proc(?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME) -> storage_vol_lookup_by_name;
+proc(storage_vol_lookup_by_name) -> ?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY) -> storage_vol_lookup_by_key;
+proc(storage_vol_lookup_by_key) -> ?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY;
+proc(?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH) -> storage_vol_lookup_by_path;
+proc(storage_vol_lookup_by_path) -> ?REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH;
+proc(?REMOTE_PROC_STORAGE_VOL_GET_INFO) -> storage_vol_get_info;
+proc(storage_vol_get_info) -> ?REMOTE_PROC_STORAGE_VOL_GET_INFO;
+proc(?REMOTE_PROC_STORAGE_VOL_DUMP_XML) -> storage_vol_dump_xml;
+proc(storage_vol_dump_xml) -> ?REMOTE_PROC_STORAGE_VOL_DUMP_XML;
+proc(?REMOTE_PROC_STORAGE_VOL_GET_PATH) -> storage_vol_get_path;
+proc(storage_vol_get_path) -> ?REMOTE_PROC_STORAGE_VOL_GET_PATH;
+proc(?REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY) -> node_get_cells_free_memory;
+proc(node_get_cells_free_memory) -> ?REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY;
+proc(?REMOTE_PROC_NODE_GET_FREE_MEMORY) -> node_get_free_memory;
+proc(node_get_free_memory) -> ?REMOTE_PROC_NODE_GET_FREE_MEMORY;
+proc(?REMOTE_PROC_DOMAIN_BLOCK_PEEK) -> domain_block_peek;
+proc(domain_block_peek) -> ?REMOTE_PROC_DOMAIN_BLOCK_PEEK;
+proc(?REMOTE_PROC_DOMAIN_MEMORY_PEEK) -> domain_memory_peek;
+proc(domain_memory_peek) -> ?REMOTE_PROC_DOMAIN_MEMORY_PEEK;
+proc(?REMOTE_PROC_DOMAIN_EVENTS_REGISTER) -> domain_events_register;
+proc(domain_events_register) -> ?REMOTE_PROC_DOMAIN_EVENTS_REGISTER;
+proc(?REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER) -> domain_events_deregister;
+proc(domain_events_deregister) -> ?REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER;
+proc(?REMOTE_PROC_DOMAIN_EVENT) -> domain_event;
+proc(domain_event) -> ?REMOTE_PROC_DOMAIN_EVENT;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2) -> domain_migrate_prepare2;
+proc(domain_migrate_prepare2) -> ?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_FINISH2) -> domain_migrate_finish2;
+proc(domain_migrate_finish2) -> ?REMOTE_PROC_DOMAIN_MIGRATE_FINISH2;
+proc(?REMOTE_PROC_GET_URI) -> get_uri;
+proc(get_uri) -> ?REMOTE_PROC_GET_URI;
+proc(?REMOTE_PROC_NODE_NUM_OF_DEVICES) -> node_num_of_devices;
+proc(node_num_of_devices) -> ?REMOTE_PROC_NODE_NUM_OF_DEVICES;
+proc(?REMOTE_PROC_NODE_LIST_DEVICES) -> node_list_devices;
+proc(node_list_devices) -> ?REMOTE_PROC_NODE_LIST_DEVICES;
+proc(?REMOTE_PROC_NODE_DEVICE_LOOKUP_BY_NAME) -> node_device_lookup_by_name;
+proc(node_device_lookup_by_name) -> ?REMOTE_PROC_NODE_DEVICE_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_NODE_DEVICE_DUMP_XML) -> node_device_dump_xml;
+proc(node_device_dump_xml) -> ?REMOTE_PROC_NODE_DEVICE_DUMP_XML;
+proc(?REMOTE_PROC_NODE_DEVICE_GET_PARENT) -> node_device_get_parent;
+proc(node_device_get_parent) -> ?REMOTE_PROC_NODE_DEVICE_GET_PARENT;
+proc(?REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS) -> node_device_num_of_caps;
+proc(node_device_num_of_caps) -> ?REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS;
+proc(?REMOTE_PROC_NODE_DEVICE_LIST_CAPS) -> node_device_list_caps;
+proc(node_device_list_caps) -> ?REMOTE_PROC_NODE_DEVICE_LIST_CAPS;
+proc(?REMOTE_PROC_NODE_DEVICE_DETTACH) -> node_device_dettach;
+proc(node_device_dettach) -> ?REMOTE_PROC_NODE_DEVICE_DETTACH;
+proc(?REMOTE_PROC_NODE_DEVICE_RE_ATTACH) -> node_device_re_attach;
+proc(node_device_re_attach) -> ?REMOTE_PROC_NODE_DEVICE_RE_ATTACH;
+proc(?REMOTE_PROC_NODE_DEVICE_RESET) -> node_device_reset;
+proc(node_device_reset) -> ?REMOTE_PROC_NODE_DEVICE_RESET;
+proc(?REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL) -> domain_get_security_label;
+proc(domain_get_security_label) -> ?REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL;
+proc(?REMOTE_PROC_NODE_GET_SECURITY_MODEL) -> node_get_security_model;
+proc(node_get_security_model) -> ?REMOTE_PROC_NODE_GET_SECURITY_MODEL;
+proc(?REMOTE_PROC_NODE_DEVICE_CREATE_XML) -> node_device_create_xml;
+proc(node_device_create_xml) -> ?REMOTE_PROC_NODE_DEVICE_CREATE_XML;
+proc(?REMOTE_PROC_NODE_DEVICE_DESTROY) -> node_device_destroy;
+proc(node_device_destroy) -> ?REMOTE_PROC_NODE_DEVICE_DESTROY;
+proc(?REMOTE_PROC_STORAGE_VOL_CREATE_XML_FROM) -> storage_vol_create_xml_from;
+proc(storage_vol_create_xml_from) -> ?REMOTE_PROC_STORAGE_VOL_CREATE_XML_FROM;
+proc(?REMOTE_PROC_NUM_OF_INTERFACES) -> num_of_interfaces;
+proc(num_of_interfaces) -> ?REMOTE_PROC_NUM_OF_INTERFACES;
+proc(?REMOTE_PROC_LIST_INTERFACES) -> list_interfaces;
+proc(list_interfaces) -> ?REMOTE_PROC_LIST_INTERFACES;
+proc(?REMOTE_PROC_INTERFACE_LOOKUP_BY_NAME) -> interface_lookup_by_name;
+proc(interface_lookup_by_name) -> ?REMOTE_PROC_INTERFACE_LOOKUP_BY_NAME;
+proc(?REMOTE_PROC_INTERFACE_LOOKUP_BY_MAC_STRING) -> interface_lookup_by_mac_string;
+proc(interface_lookup_by_mac_string) -> ?REMOTE_PROC_INTERFACE_LOOKUP_BY_MAC_STRING;
+proc(?REMOTE_PROC_INTERFACE_GET_XML_DESC) -> interface_get_xml_desc;
+proc(interface_get_xml_desc) -> ?REMOTE_PROC_INTERFACE_GET_XML_DESC;
+proc(?REMOTE_PROC_INTERFACE_DEFINE_XML) -> interface_define_xml;
+proc(interface_define_xml) -> ?REMOTE_PROC_INTERFACE_DEFINE_XML;
+proc(?REMOTE_PROC_INTERFACE_UNDEFINE) -> interface_undefine;
+proc(interface_undefine) -> ?REMOTE_PROC_INTERFACE_UNDEFINE;
+proc(?REMOTE_PROC_INTERFACE_CREATE) -> interface_create;
+proc(interface_create) -> ?REMOTE_PROC_INTERFACE_CREATE;
+proc(?REMOTE_PROC_INTERFACE_DESTROY) -> interface_destroy;
+proc(interface_destroy) -> ?REMOTE_PROC_INTERFACE_DESTROY;
+proc(?REMOTE_PROC_DOMAIN_XML_FROM_NATIVE) -> domain_xml_from_native;
+proc(domain_xml_from_native) -> ?REMOTE_PROC_DOMAIN_XML_FROM_NATIVE;
+proc(?REMOTE_PROC_DOMAIN_XML_TO_NATIVE) -> domain_xml_to_native;
+proc(domain_xml_to_native) -> ?REMOTE_PROC_DOMAIN_XML_TO_NATIVE;
+proc(?REMOTE_PROC_NUM_OF_DEFINED_INTERFACES) -> num_of_defined_interfaces;
+proc(num_of_defined_interfaces) -> ?REMOTE_PROC_NUM_OF_DEFINED_INTERFACES;
+proc(?REMOTE_PROC_LIST_DEFINED_INTERFACES) -> list_defined_interfaces;
+proc(list_defined_interfaces) -> ?REMOTE_PROC_LIST_DEFINED_INTERFACES;
+proc(?REMOTE_PROC_NUM_OF_SECRETS) -> num_of_secrets;
+proc(num_of_secrets) -> ?REMOTE_PROC_NUM_OF_SECRETS;
+proc(?REMOTE_PROC_LIST_SECRETS) -> list_secrets;
+proc(list_secrets) -> ?REMOTE_PROC_LIST_SECRETS;
+proc(?REMOTE_PROC_SECRET_LOOKUP_BY_UUID) -> secret_lookup_by_uuid;
+proc(secret_lookup_by_uuid) -> ?REMOTE_PROC_SECRET_LOOKUP_BY_UUID;
+proc(?REMOTE_PROC_SECRET_DEFINE_XML) -> secret_define_xml;
+proc(secret_define_xml) -> ?REMOTE_PROC_SECRET_DEFINE_XML;
+proc(?REMOTE_PROC_SECRET_GET_XML_DESC) -> secret_get_xml_desc;
+proc(secret_get_xml_desc) -> ?REMOTE_PROC_SECRET_GET_XML_DESC;
+proc(?REMOTE_PROC_SECRET_SET_VALUE) -> secret_set_value;
+proc(secret_set_value) -> ?REMOTE_PROC_SECRET_SET_VALUE;
+proc(?REMOTE_PROC_SECRET_GET_VALUE) -> secret_get_value;
+proc(secret_get_value) -> ?REMOTE_PROC_SECRET_GET_VALUE;
+proc(?REMOTE_PROC_SECRET_UNDEFINE) -> secret_undefine;
+proc(secret_undefine) -> ?REMOTE_PROC_SECRET_UNDEFINE;
+proc(?REMOTE_PROC_SECRET_LOOKUP_BY_USAGE) -> secret_lookup_by_usage;
+proc(secret_lookup_by_usage) -> ?REMOTE_PROC_SECRET_LOOKUP_BY_USAGE;
+proc(?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL) -> domain_migrate_prepare_tunnel;
+proc(domain_migrate_prepare_tunnel) -> ?REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL;
+proc(?REMOTE_PROC_IS_SECURE) -> is_secure;
+proc(is_secure) -> ?REMOTE_PROC_IS_SECURE;
+proc(?REMOTE_PROC_DOMAIN_IS_ACTIVE) -> domain_is_active;
+proc(domain_is_active) -> ?REMOTE_PROC_DOMAIN_IS_ACTIVE;
+proc(?REMOTE_PROC_DOMAIN_IS_PERSISTENT) -> domain_is_persistent;
+proc(domain_is_persistent) -> ?REMOTE_PROC_DOMAIN_IS_PERSISTENT;
+proc(?REMOTE_PROC_NETWORK_IS_ACTIVE) -> network_is_active;
+proc(network_is_active) -> ?REMOTE_PROC_NETWORK_IS_ACTIVE;
+proc(?REMOTE_PROC_NETWORK_IS_PERSISTENT) -> network_is_persistent;
+proc(network_is_persistent) -> ?REMOTE_PROC_NETWORK_IS_PERSISTENT;
+proc(?REMOTE_PROC_STORAGE_POOL_IS_ACTIVE) -> storage_pool_is_active;
+proc(storage_pool_is_active) -> ?REMOTE_PROC_STORAGE_POOL_IS_ACTIVE;
+proc(?REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT) -> storage_pool_is_persistent;
+proc(storage_pool_is_persistent) -> ?REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT;
+proc(?REMOTE_PROC_INTERFACE_IS_ACTIVE) -> interface_is_active;
+proc(interface_is_active) -> ?REMOTE_PROC_INTERFACE_IS_ACTIVE;
+proc(?REMOTE_PROC_GET_LIB_VERSION) -> get_lib_version;
+proc(get_lib_version) -> ?REMOTE_PROC_GET_LIB_VERSION;
+proc(?REMOTE_PROC_CPU_COMPARE) -> cpu_compare;
+proc(cpu_compare) -> ?REMOTE_PROC_CPU_COMPARE;
+proc(?REMOTE_PROC_DOMAIN_MEMORY_STATS) -> domain_memory_stats;
+proc(domain_memory_stats) -> ?REMOTE_PROC_DOMAIN_MEMORY_STATS;
+
+proc(_) -> unknown.
+
+type(?REMOTE_CALL) -> call;
+type(call) -> ?REMOTE_CALL;
+type(?REMOTE_REPLY) -> reply;
+type(reply) -> ?REMOTE_REPLY;
+type(?REMOTE_MESSAGE) -> message;
+type(message) -> ?REMOTE_MESSAGE;
+type(?REMOTE_STREAM) -> stream;
+type(stream) -> ?REMOTE_STREAM;
+
+type(_) -> unknown.
+
+status(?REMOTE_OK) -> ok;
+status(ok) -> ?REMOTE_OK;
+status(?REMOTE_ERROR) -> error;
+status(error) -> ?REMOTE_ERROR;
+status(?REMOTE_CONTINUE) -> continue;
+status(continue) -> ?REMOTE_CONTINUE;
+
+status(_) -> unknown.
+
237 src/verx_err.erl
@@ -0,0 +1,237 @@
+%% Copyright (c) 2011, Michael Santos <michael.santos@gmail.com>
+%% All rights reserved.
+%%
+%% Redistribution and use in source and binary forms, with or without
+%% modification, are permitted provided that the following conditions
+%% are met:
+%%
+%% Redistributions of source code must retain the above copyright
+%% notice, this list of conditions and the following disclaimer.
+%%
+%% Redistributions in binary form must reproduce the above copyright
+%% notice, this list of conditions and the following disclaimer in the
+%% documentation and/or other materials provided with the distribution.
+%%
+%% Neither the name of the author nor the names of its contributors
+%% may be used to endorse or promote products derived from this software
+%% without specific prior written permission.
+%%
+%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%% COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%% POSSIBILITY OF SUCH DAMAGE.
+-module(verx_err).
+-export([level/1,from/1,code/1]).
+-include("verx_err.hrl").
+
+level(?VIR_ERR_NONE) -> none;
+level(none) -> ?VIR_ERR_NONE;
+level(?VIR_ERR_WARNING) -> warning;
+level(warning) -> ?VIR_ERR_WARNING;
+level(?VIR_ERR_ERROR) -> error;
+level(error) -> ?VIR_ERR_ERROR;
+
+level(_) -> unknown.
+
+
+from(?VIR_FROM_NONE) -> none;
+from(none) -> ?VIR_FROM_NONE;
+from(?VIR_FROM_XEN) -> xen;
+from(xen) -> ?VIR_FROM_XEN;
+from(?VIR_FROM_XEND) -> xend;
+from(xend) -> ?VIR_FROM_XEND;
+from(?VIR_FROM_XENSTORE) -> xenstore;
+from(xenstore) -> ?VIR_FROM_XENSTORE;
+from(?VIR_FROM_SEXPR) -> sexpr;
+from(sexpr) -> ?VIR_FROM_SEXPR;
+from(?VIR_FROM_XML) -> xml;
+from(xml) -> ?VIR_FROM_XML;
+from(?VIR_FROM_DOM) -> dom;
+from(dom) -> ?VIR_FROM_DOM;
+from(?VIR_FROM_RPC) -> rpc;
+from(rpc) -> ?VIR_FROM_RPC;
+from(?VIR_FROM_PROXY) -> proxy;
+from(proxy) -> ?VIR_FROM_PROXY;
+from(?VIR_FROM_CONF) -> conf;
+from(conf) -> ?VIR_FROM_CONF;
+from(?VIR_FROM_QEMU) -> qemu;
+from(qemu) -> ?VIR_FROM_QEMU;
+from(?VIR_FROM_NET) -> net;
+from(net) -> ?VIR_FROM_NET;
+from(?VIR_FROM_TEST) -> test;
+from(test) -> ?VIR_FROM_TEST;
+from(?VIR_FROM_REMOTE) -> remote;
+from(remote) -> ?VIR_FROM_REMOTE;
+from(?VIR_FROM_OPENVZ) -> openvz;
+from(openvz) -> ?VIR_FROM_OPENVZ;
+from(?VIR_FROM_XENXM) -> xenxm;
+from(xenxm) -> ?VIR_FROM_XENXM;
+from(?VIR_FROM_STATS_LINUX) -> stats_linux;
+from(stats_linux) -> ?VIR_FROM_STATS_LINUX;
+from(?VIR_FROM_LXC) -> lxc;
+from(lxc) -> ?VIR_FROM_LXC;
+from(?VIR_FROM_STORAGE) -> storage;
+from(storage) -> ?VIR_FROM_STORAGE;
+from(?VIR_FROM_NETWORK) -> network;
+from(network) -> ?VIR_FROM_NETWORK;
+from(?VIR_FROM_DOMAIN) -> domain;
+from(domain) -> ?VIR_FROM_DOMAIN;
+from(