Slackware-current에서 Libvirt 및 bash 완료: 도메인이 완료되지 않은 이유는 무엇입니까?

Slackware-current에서 Libvirt 및 bash 완료: 도메인이 완료되지 않은 이유는 무엇입니까?

Slackware-current에서는 상황이 매우 이상합니다. libvirt-6.8.0 소스 코드로 컴파일합니다.

Bash 완성을 시작해보자

virst st<TAB>
virsh start OK

virsh start --dom<TAB>
virsh start --domain OK

virsh start --domain <TAB>
Display all 235 possibilities? (y or n)

235가지 가능성? 나는 15개의 도메인만 구성했고 235개의 파일은 집에 있는 내 파일과 디렉터리입니다. bash 완료로는 도메인 목록을 완료할 수 없는 것 같습니다. 다른 명령(virsh domiflist, virsh dominfo, virsh domifaddr)은 탭 완성에서 제대로 작동합니다. 모든 예상 필드 목록입니다. 모든 libvirt 파일을 제거하고 libvirt를 다시 설치해 보았지만 아무 것도 없었습니다... 내 도메인 bash가 완료되지 못하게 하는 이유는 무엇입니까?

bash 디버깅을 시도했습니다.

set -x

명령 실행

virsh start --domain ce<TAB>

+ local flag_all=1 array ret a b ifaces nwfilters files
+ COMPREPLY=()
+ cur=cen
+ prev=--domain
+++ virsh -h
+++ grep '^    '
+++ cut '-d ' -f5
+++ virsh -h
+++ cut -d= -f1
+++ grep '\--'
+++ cut '-d ' -f7
++ echo '-c
-d
-e
-h
-k

-K

-l
-q
-r
-t
-v
-V

attach-device
attach-disk
...
very long list of virsh commands
cd
echo
exit
help
pwd
quit
connect' '--connect
--debug
--escape
--help
--keepalive-interval
--keepalive-count
--log
--quiet
--readonly
--timing'
+ cmds='-c
-d
-e
-h
-k

-K

-l
-q
-r
-t
-v
-V

attach-device
...
very long list of virsh commands
echo
exit
help
pwd
quit
connect --connect
--debug
--escape
--help
--keepalive-interval
--keepalive-count
--log
--quiet
--readonly
--timing'
++ virsh help
++ grep '^    '
++ cut '-d ' -f5
+ cmds_help='attach-device
attach-disk
attach-interface
autostart
blkdeviotune
blkiotune
blockcommit
...very long list of virsh commands
cd
echo
exit
help
pwd
quit
connect'
+ case "$prev" in
++ _virsh_list_domains 1
++ local flag_all=1 flags
++ '[' 1 -eq 1 ']'
++ flags=--all
++ virsh -q list --all
++ cut '-d ' -f7
++ awk '{print $1}'
+ doms=
+ COMPREPLY=($(compgen -W "$doms" -- "$cur"))
++ compgen -W '' -- cen
+ return 0

답변1

해결책을 찾으세요. libvirt 읽기가 완료된 것 같아요

/usr/share/bash-completion/completions/vsh

하지만 "침입자"의 이전 파일을 읽는 중입니다./etc/bash_completion.d/virsh_bash_completion

이 파일을 /etc/bash_completion.d/virsh_bash_completion에 복사하는 문제를 해결했습니다.

sudo cp  /usr/share/bash-completion/completions/vsh /etc/bash_completion.d/virsh_bash_completion

이제 모든 것이 잘 작동합니다.

관련 정보