changeset 72:28dcbf278912

remove define-gdb
author AnaTofuZ <anatofuz@gmail.com>
date Sun, 20 Dec 2020 15:38:43 +0900
parents da011807db95
children 1939d3b5722d
files src/main.rs
diffstat 1 files changed, 8 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.rs	Sun Dec 20 15:18:29 2020 +0900
+++ b/src/main.rs	Sun Dec 20 15:38:43 2020 +0900
@@ -20,7 +20,6 @@
     Ttyconsole(TTyconsole),
     Vncdisplay(Vncdisplay),
     Dumpxml(Dumpxml),
-    DefineGDB(DefineGDB),
     Domiflist(Domiflist),
     Dominfo(Dominfo),
     Templates(Templates),
@@ -31,12 +30,6 @@
 #[derive(Clap)]
 struct Templates {}
 
-/// define the domain in which the gdb port is opened from the template XML file
-#[derive(Clap)]
-struct DefineGDB {
-    name: String,
-}
-
 /// define (but don't start) a domain from an template XML file
 #[derive(Clap)]
 struct Define {
@@ -44,6 +37,10 @@
     /// create a VM with a differential from the template VM registered in $ie-virsh templates
     #[clap(short, long, parse(from_str))]
     template: Option<String>,
+
+    /// define the domain in which the gdb port is opened from the template XML file
+    #[clap(short, long)]
+    gdb: Option<bool>,
 }
 
 /// domain information in XML
@@ -148,21 +145,13 @@
                 command::define_from_template(&userdetail, &arg.name, &template);
                 return;
             }
+            if let Some(_) = arg.gdb {
+                command::define_gdb(&userdetail, &arg.name);
+                return;
+            }
             command::define(&userdetail, &arg.name);
         }
 
-        SubCommand::DefineGDB(arg) => {
-            user::set_root_id();
-            let user = user::User {
-                uid,
-                gid,
-                name: user_name,
-            };
-
-            let userdetail = user::UserDetail::new(&user);
-            command::define_gdb(&userdetail, &arg.name);
-        }
-
         SubCommand::Shutdown(arg) => {
             user::set_root_id();
             command::subshell(&user_name, &arg.name, "shutdown");