Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Kludge to add headers to code path

  • Loading branch information...
commit 276b1db180cab9e122ce9721b503d9e500d6054e 1 parent 5b9221d
@msantos authored
View
26 README.md
@@ -53,6 +53,32 @@ environment variables before running the script:
VERX_QEMU_BIN : path to the qemu binary (default: /usr/bin/kvm)
VERX_BRIDGE_INTERFACE : bridge interface (default: user networking)
+## TESTING EVERYTHING WORKS
+
+To quickly test everything works, you can try running `bin/verx`, an
+escript that provides a simple command line interface to the verx library.
+
+You'll have to set up the ERL\_LIBS environment variable first, e.g.,
+if verx is checked out in ~/src:
+
+ export ERL_LIBS=$ERL_LIBS:~/src
+
+Then run:
+
+ bin/verx
+
+To create the example VM:
+
+ bin/verx create priv/example.xml
+
+To see all the VMs (if you have TLS set up):
+
+ bin/verx list --all --transport verx_client_tls
+
+To connect to example VM's console using the Unix transport:
+
+ bin/verx console localvm # control-C to exit
+
## HOW TO USE IT
## libvirt documentation
View
4 bin/verx
@@ -4,7 +4,7 @@
%%% Command line interface using the libvirt remote protocol
%%%
-include_lib("kernel/include/file.hrl").
--include("$PWD/include/verx.hrl").
+-include_lib("verx/include/verx.hrl").
main(Opt) ->
% load verx
@@ -390,6 +390,6 @@ console_read(Ref) ->
io:format("~s", [Buf]),
console_read(Ref);
{tty_read, Buf} ->
- verx_client:send(Ref, [Buf]),
+ verx_client:send(Ref, Buf),
console_read(Ref)
end.
View
3  include/verx.hrl
@@ -28,8 +28,7 @@
%% 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.
-%-include("include/remote_protocol.hrl").
--include("$PWD/include/remote_protocol.hrl").
+-include_lib("verx/include/remote_protocol.hrl").
-define(LIBVIRT_SOCK_PATH, <<"/var/run/libvirt/libvirt-sock">>).
-define(LIBVIRT_TCP_PORT, 16509).
View
2  rebar.config
@@ -17,3 +17,5 @@
"src/remote_protocol.x",
"src/remote_protocol.hrl"
]}.
+
+{lib_dirs, ["../"]}.
View
2  src/verx_client.erl
@@ -93,6 +93,8 @@ cast(Ref, Proc, Arg, Timeout)
when is_pid(Ref), is_atom(Proc), is_list(Arg) ->
gen_server:call(Ref, {call, Proc, Arg}, Timeout).
+send(Ref, Buf) when is_binary(Buf) ->
+ send(Ref, [Buf]);
send(_Ref, []) ->
ok;
send(Ref, [Buf|Rest]) when is_binary(Buf) ->
Please sign in to comment.
Something went wrong with that request. Please try again.