Mercurial > hg > Members > anatofuz > ie-virsh
comparison src/main.rs @ 22:78f246ce5235
fix cmd name
author | AnaTofuZ <k198584@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 03 Nov 2020 17:44:19 +0900 |
parents | da4858f4658d |
children | 0ee235caebc5 e8ba0f63c227 |
comparison
equal
deleted
inserted
replaced
21:9f3d29b8561a | 22:78f246ce5235 |
---|---|
9 } | 9 } |
10 | 10 |
11 #[derive(Clap)] | 11 #[derive(Clap)] |
12 enum SubCommand { | 12 enum SubCommand { |
13 List(List), | 13 List(List), |
14 Undefine(UnDefine), | 14 Undefine(Undefine), |
15 Define(Define), | 15 Define(Define), |
16 Shutdown(Shutdown), | 16 Shutdown(Shutdown), |
17 Destroy(Destroy), | 17 Destroy(Destroy), |
18 Console(Console), | 18 Console(Console), |
19 Start(Start), | 19 Start(Start), |
20 Ttyconsole(TTyConsole), | 20 Ttyconsole(TTyconsole), |
21 VNCDisplay(VNCDisplay), | 21 VNCDisplay(VNCDisplay), |
22 DumpXML(DumpXML), | 22 Dumpxml(Dumpxml), |
23 DefineGDB(DefineGDB), | 23 DefineGDB(DefineGDB), |
24 DomIfList(DomIfList), | 24 Domiflist(Domiflist), |
25 DomInfo(DomInfo), | 25 Dominfo(Dominfo), |
26 } | 26 } |
27 | 27 |
28 /// define the domain in which the gdb port is opened from the template XML file | 28 /// define the domain in which the gdb port is opened from the template XML file |
29 #[derive(Clap)] | 29 #[derive(Clap)] |
30 struct DefineGDB { | 30 struct DefineGDB { |
37 name: String, | 37 name: String, |
38 } | 38 } |
39 | 39 |
40 /// domain information in XML | 40 /// domain information in XML |
41 #[derive(Clap)] | 41 #[derive(Clap)] |
42 struct DumpXML { | 42 struct Dumpxml { |
43 name: String, | 43 name: String, |
44 } | 44 } |
45 | 45 |
46 /// vncdisplay | 46 /// vncdisplay |
47 #[derive(Clap)] | 47 #[derive(Clap)] |
49 name: String, | 49 name: String, |
50 } | 50 } |
51 | 51 |
52 /// undefine a domain | 52 /// undefine a domain |
53 #[derive(Clap)] | 53 #[derive(Clap)] |
54 struct UnDefine { | 54 struct Undefine { |
55 name: String, | 55 name: String, |
56 } | 56 } |
57 | 57 |
58 /// start a (previously defined) inactive domain | 58 /// start a (previously defined) inactive domain |
59 #[derive(Clap)] | 59 #[derive(Clap)] |
61 name: String, | 61 name: String, |
62 } | 62 } |
63 | 63 |
64 /// tty console | 64 /// tty console |
65 #[derive(Clap)] | 65 #[derive(Clap)] |
66 struct TTyConsole { | 66 struct TTyconsole { |
67 name: String, | 67 name: String, |
68 } | 68 } |
69 | 69 |
70 /// gracefully shutdown a domain | 70 /// gracefully shutdown a domain |
71 #[derive(Clap)] | 71 #[derive(Clap)] |
89 name: String, | 89 name: String, |
90 } | 90 } |
91 | 91 |
92 /// list all domain virtual interfaces | 92 /// list all domain virtual interfaces |
93 #[derive(Clap)] | 93 #[derive(Clap)] |
94 struct DomIfList { | 94 struct Domiflist { |
95 name: String, | 95 name: String, |
96 } | 96 } |
97 | 97 |
98 /// domain information | 98 /// domain information |
99 #[derive(Clap)] | 99 #[derive(Clap)] |
100 struct DomInfo { | 100 struct Dominfo { |
101 name: String, | 101 name: String, |
102 } | 102 } |
103 | 103 |
104 fn main() { | 104 fn main() { |
105 let opts: Opts = Opts::parse(); | 105 let opts: Opts = Opts::parse(); |
148 SubCommand::Ttyconsole(arg) => { | 148 SubCommand::Ttyconsole(arg) => { |
149 user::set_root_id(); | 149 user::set_root_id(); |
150 command::ttyconsole(user_name, arg.name); | 150 command::ttyconsole(user_name, arg.name); |
151 } | 151 } |
152 | 152 |
153 SubCommand::DumpXML(arg) => { | 153 SubCommand::Dumpxml(arg) => { |
154 user::set_root_id(); | 154 user::set_root_id(); |
155 command::ttyconsole(user_name, arg.name); | 155 command::dumpxml(user_name, arg.name); |
156 } | 156 } |
157 | 157 |
158 SubCommand::Undefine(arg) => { | 158 SubCommand::Undefine(arg) => { |
159 user::set_root_id(); | 159 user::set_root_id(); |
160 command::undefine(user_name, arg.name); | 160 command::undefine(user_name, arg.name); |
161 } | 161 } |
162 | 162 |
163 SubCommand::DomIfList(arg) => { | 163 SubCommand::Domiflist(arg) => { |
164 user::set_root_id(); | 164 user::set_root_id(); |
165 command::domiflist(user_name, arg.name); | 165 command::domiflist(user_name, arg.name); |
166 } | 166 } |
167 | 167 |
168 SubCommand::DomInfo(arg) => { | 168 SubCommand::Dominfo(arg) => { |
169 user::set_root_id(); | 169 user::set_root_id(); |
170 command::dominfo(user_name, arg.name); | 170 command::dominfo(user_name, arg.name); |
171 } | 171 } |
172 | 172 |
173 _ => {} | 173 _ => {} |