diff src/command.rs @ 37:0f966575a56a

use commond_cmd
author AnaTofuZ <anatofuz@gmail.com>
date Sun, 22 Nov 2020 11:20:34 +0900
parents 91a99ff9c4c5
children 6f1b90844b7f
line wrap: on
line diff
--- a/src/command.rs	Sun Nov 22 11:03:09 2020 +0900
+++ b/src/command.rs	Sun Nov 22 11:20:34 2020 +0900
@@ -35,41 +35,10 @@
     virsh::command_require_vm_name(get_vm_name(user_name, vm_name), "start");
 }
 
-pub fn shutdown(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "shutdown")
-}
-
-pub fn destroy(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "destroy")
-}
-
-pub fn console(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "console")
-}
-
-pub fn vncdisplay(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "vncdisplay")
+pub fn common_cmd(user_name: &str, vm_name: &str, command: &str) {
+    exec_cmd_from_name_or_id(user_name, vm_name, command)
 }
 
-pub fn ttyconsole(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "ttyconsole")
-}
-
-pub fn dumpxml(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "dumpxml")
-}
-
-pub fn undefine(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "undefine")
-}
-
-pub fn domiflist(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "domiflist")
-}
-
-pub fn dominfo(user_name: &str, vm_name: &str) {
-    exec_cmd_from_name_or_id(user_name, vm_name, "dominfo")
-}
 
 pub fn dumpvncpasswd(_user_name: &str, _vm_name: &str) {}