LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-08-2020, 02:34 PM   #1
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
Virsh and bash completion, what can block it?


Very strange situation on Slackware-current.
With libvirt-6.8.0 compiled by source.

Let start bash completion
Code:
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 possibilities? I have only 15 domains configured and the 235 files are my files and dirs in home, seems bash completion cannot complete the domain list, the other commands (virsh domiflist, virsh dominfo, virsh domifaddr) works fine with tab completion. All expect domain list.
I have try removing all libvirt files, and reinstall libvirt but nothing...
what can block my domain bash completion?

I have tried to debug bash

Code:
set -x
Run command

Code:
    virsh start --domain ce<TAB>
Code:
 
    + 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

Last edited by camerabambai; 10-08-2020 at 02:49 PM.
 
Old 10-08-2020, 03:36 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
TAB completion doesn't work after a white space. Instead it lists all files in the directory. This was expected.
 
Old 10-08-2020, 07:51 PM   #3
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Original Poster
Rep: Reputation: 54
Solution found.
I think libvirt read completion from

Code:
/usr/share/bash-completion/completions/vsh
But read from an "intruder" old file in `/etc/bash_completion.d/virsh_bash_completion`

I solved copy this file into /etc/bash_completion.d/virsh_bash_completion

Now works all.

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


Reply

Tags
bash-completion, solved



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Create, Revert and Delete KVM Virtual machine (domain) snapshot with virsh command LXer Syndicated Linux News 0 02-07-2018 07:12 AM
Help- How can I virsh into a Qemu-KVM VM started from an NFS mounted image file ? -Soufiane- Linux - Virtualization and Cloud 3 08-18-2016 05:27 AM
[SOLVED] questions about virsh memory setting and vcpu setting LQParsons Linux - Virtualization and Cloud 5 09-05-2015 09:34 AM
bash: check periodically until 'virsh blockjob dom vda' shows 100% completion himpierre Programming 2 06-03-2013 06:14 AM
Xen, xendomain and virsh matiasquestions Linux - Software 0 12-04-2007 12:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration