Skip to content

Commit

Permalink
vert: add define/undefine domain
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Aug 25, 2012
1 parent 003e442 commit 3b435ea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bin/vert
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -152,6 +169,7 @@ main(_) ->
"ctl-alt-del",
"console",
"create",
"define",
"destroy",
"freecell",
"hostname",
Expand All @@ -161,6 +179,7 @@ main(_) ->
"recv",
"send",
"shutdown",
"undefine",
"uri"
],
rp(Help),
Expand Down

0 comments on commit 3b435ea

Please sign in to comment.