Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

vert: add define/undefine domain

  • Loading branch information...
commit 3b435eaecb630be7cd22cf49b156422fde6a9241 1 parent 003e442
@msantos authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 bin/vert
View
19 bin/vert
@@ -36,6 +36,17 @@ main(["create", Host | Arg]) ->
main(["ctl-alt-del", Host | Arg]) ->
main(["send-key", Host, "29 56 111" | Arg]);
+main(["define", File | Arg]) ->
+ Opt = getopt(Arg),
+ {ok, Connect} = connect(Opt),
+ Res = case file:read_file(File) of
+ {ok, XML} ->
+ vert:virDomainDefineXML(Connect, XML);
+ Error ->
+ Error
+ end,
+ rp(Res);
+
main(["destroy", Host | Arg]) ->
Opt = getopt(Arg),
{ok, Connect} = connect(Opt),
@@ -141,6 +152,12 @@ main(["shutdown", Host | Arg]) ->
{ok, Domain} = domain(Connect, Host),
rp(vert:virDomainShutdown(Domain));
+main(["undefine", Host | Arg]) ->
+ Opt = getopt(Arg),
+ {ok, Connect} = connect(Opt),
+ {ok, Domain} = domain(Connect, Host),
+ rp(vert:virDomainUndefine(Domain));
+
main(["uri" | Arg]) ->
Opt = getopt(Arg),
{ok, Connect} = connect(Opt),
@@ -152,6 +169,7 @@ main(_) ->
"ctl-alt-del",
"console",
"create",
+ "define",
"destroy",
"freecell",
"hostname",
@@ -161,6 +179,7 @@ main(_) ->
"recv",
"send",
"shutdown",
+ "undefine",
"uri"
],
rp(Help),
Please sign in to comment.
Something went wrong with that request. Please try again.