diff src/command.rs @ 19:d37203a877d9

add xml parse/writer
author AnaTofuZ <k198584@ie.u-ryukyu.ac.jp>
date Tue, 03 Nov 2020 11:10:24 +0900
parents 9b24d6767a2f
children da4858f4658d
line wrap: on
line diff
--- a/src/command.rs	Mon Nov 02 18:59:52 2020 +0900
+++ b/src/command.rs	Tue Nov 03 11:10:24 2020 +0900
@@ -1,4 +1,5 @@
 use super::virsh;
+use super::xml;
 
 pub fn list(user_name: &'static str) {
     let (ldump_msg, vm_list_strs) = virsh::get_vm_list(user_name);
@@ -9,6 +10,10 @@
     }
 }
 
+pub fn define(user_name: &'static str, vm_name: String) {
+    xml::generate();
+}
+
 pub fn start(user_name: &'static str, vm_name: String) {
     virsh::command_require_vm_name(get_vm_name(user_name, &vm_name), "start");
 }
@@ -41,6 +46,13 @@
     exec_cmd_from_name_or_id(user_name, &vm_name, "undefine")
 }
 
+pub fn domiflist(user_name: &'static str, vm_name: String) {
+    exec_cmd_from_name_or_id(user_name, &vm_name, "domiflist")
+}
+
+pub fn dominfo(user_name: &'static str, vm_name: String) {
+    exec_cmd_from_name_or_id(user_name, &vm_name, "dominfo")
+}
 
 fn exec_cmd_from_name_or_id(user_name: &'static str, name_or_id: &str, command: &str) {
     if name_or_id.parse::<u8>().is_ok() {