Skip to content

Commit

Permalink
kiss-vm: optimize code
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed May 9, 2021
1 parent 70266a0 commit d5323ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kiss-vm
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ get_default_if() {
}

# command line parse
orig_at=("$@")
_at=`getopt -o hd:Ll:C:fn:gb:p:Ii:rvdx::Pqw \
--long help \
--long prepare \
Expand Down Expand Up @@ -1624,8 +1625,9 @@ if egrep -q -wo '(vmx|svm)' /proc/cpuinfo || egrep -q 'CPU 0000%@' /proc/cpuinfo
if ! id | egrep -qw libvirt; then
expect <(cat <<-EOF
set timeout -1
log_user 0
spawn -noecho newgrp libvirt
expect "*\[>\$]" { send "$P ${@}; exit \$?\r"; interact; }
expect "*\[>\$]" { send ": newgrp libvirt; $P ${orig_at[@]}; exit \$?\r"; interact; }
foreach {pid spawnid os_error_flag value} [wait] break
exit \$value
EOF
Expand Down

0 comments on commit d5323ff

Please sign in to comment.