virsh lacks bash completion

Bug #457163 reported by karaluh
44
This bug affects 10 people
Affects Status Importance Assigned to Milestone
libvirt
Confirmed
Medium
bash-completion (Ubuntu)
Invalid
Undecided
Unassigned
libvirt (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

As written in summary

ProblemType: Bug
Architecture: i386
Date: Wed Oct 21 14:56:45 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: fglrx
Package: libvirt-bin 0.7.0-1ubuntu12
ProcEnviron:
 LANGUAGE=pl_PL:pl:en_GB:en
 PATH=(custom, no user)
 LANG=pl_PL.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-13.44-generic
SourcePackage: libvirt
Uname: Linux 2.6.31-13-generic i686

Revision history for this message
karaluh (karaluh) wrote :
Changed in libvirt (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at http://libvirt.org/bugs.html. If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about its status. Thanks in advance.

Changed in libvirt (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
karaluh (karaluh) wrote :

Reported upstream

Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Geoff Low (grlownzl-gmail) wrote :

I know this is being tracked upstream, I've attached something I've (literally) thrown together. Someone with a bit more finesse may be able to get it to a better state

Geoff

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Geoff,

thanks for the prototype. I just tested it, and it seems to work great and be very useful. I actually dont' know that this has been brought upstream at all. I didn't see anything in the libvirt mailing list archives. If you wanted to pursue that, that could be good.

However, while it would be good to send this upstream so they can make use of it, I don't see why it needs to go in through upstream, as it's pretty stand-alone. Is there a good reason not to put this into /etc/bash_completion.d through our package?

(@Jamie, that's aimed at you :)

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Geoff,

the only thing I notice in your competions script is that it doesn't autocomplete names for other connections, so in particular

   virsh -c lxc:/// start <tab>

does not complete with the available lxc containers. Is this something you've already fixed in your own version?

I've marked this as affecting the package bash-completions, in the hopes that it can be pulled in there (for P, presumably not oneiric :)

Revision history for this message
Geoff Low (grlownzl-gmail) wrote : Re: [Bug 457163] Re: virsh lacks bash completion

Hi Serge

I'll have to hunt around for the source, I've since left the place
where I wrote that. I do recall updating it, but it may take me a
while to source it.

Geoff

On 5 October 2011 07:32, Serge Hallyn <email address hidden> wrote:
> @Geoff,
>
> the only thing I notice in your competions script is that it doesn't
> autocomplete names for other connections, so in particular
>
>   virsh -c lxc:/// start <tab>
>
> does not complete with the available lxc containers.  Is this something
> you've already fixed in your own version?
>
> I've marked this as affecting the package bash-completions, in the hopes
> that it can be pulled in there (for P, presumably not oneiric :)
>
> ** Also affects: bash-completion (Ubuntu)
>   Importance: Undecided
>       Status: New
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (400404).
> https://bugs.launchpad.net/bugs/457163
>
> Title:
>  virsh lacks bash completion
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/libvirt/+bug/457163/+subscriptions
>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Geoff Low

187 Radstock Way
Merstham
Surrey
UK
RH1 3NQ

Ph: 01737817798
Mb: 07817754159
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Serge,

Not having looked at the file, just dropping a file into /etc/bash_completion.d is totally fine and is an easy packaging change without a huge Ubuntu delta. We should send upstream and to Debian, but I don't think we need to block on it.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This version of the bash completion file works for me with '-c lxc:///'. I'd like to think there was a cleaner way of handling this though.

Changed in bash-completion (Ubuntu):
status: New → Invalid
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

My intent is to add this to the libvirt package as soon as I've merged the newest package into P.

Changed in libvirt:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Hans-Christoph Steiner (eighthave) wrote :
Changed in libvirt (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Upstream actually has completion, and we ship it since cosmic IIRC.

From the build:
checking for BASH_COMPLETION... yes
checking for bash-completions directory... /usr/share/bash-completion/completions

configure: bash_completion: yes (CFLAGS='' LIBS='')

/usr/bin/install -c ../../../tools/bash-completion/vsh \
 "/<<PKGBUILDDIR>>/debian/tmp/usr/share/bash-completion/completions/vsh"
( cd /<<PKGBUILDDIR>>/debian/tmp/usr/share/bash-completion/completions && \
 rm -f virsh virt-admin && \
 ln -s vsh virsh && \
 ln -s vsh virt-admin )

Since
libvirt (4.5.0-1) unstable; urgency=medium
  * [882c646] Install bash completion (Closes: #902450)

That said in Cosmic I have it all working as intented:
ubuntu@c:~$ virsh l
list lxc-enter-namespace
ubuntu@c:~$ virsh list --
--all --managed-save --persistent --state-running --title --with-managed-save --without-snapshot
--autostart --name --state-other --state-shutoff --transient --with-snapshot
--inactive --no-autostart --state-paused --table --uuid --without-managed-save
ubuntu@c:~$ virsh list --a
--all --autostart

Changed in libvirt (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.