# HG changeset patch # User AnaTofuZ # Date 1608446323 -32400 # Node ID 28dcbf278912f866319e81c6c291e33fabb8d986 # Parent da011807db95af9edc7b4ef09b25e1da6725a92e remove define-gdb diff -r da011807db95 -r 28dcbf278912 src/main.rs --- 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, + + /// define the domain in which the gdb port is opened from the template XML file + #[clap(short, long)] + gdb: Option, } /// 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");