[PATCH] virsh: Allow listing just domain IDs

Michal Prívozník mprivozn at redhat.com
Tue Oct 20 13:02:07 UTC 2020


On 10/20/20 2:46 PM, Peter Krempa wrote:
> On Tue, Oct 20, 2020 at 12:27:27 +0200, Michal Privoznik wrote:
>> Some completers for libvirt related tools might want to list
>> domain IDs only. Just like the one I've implemented for
>> virt-viewer [1]. I've worked around it using some awk magic,
>> but if it was possible to just 'virsh list --id' then I could
>> drop awk.
> 
> IMO completing numeric IDs doesn't make much sense, they aren't
> descriptive at all and I don't really see a point for users using them
> on a commandline. If you are expanding both names and IDs then you'll
> have twice as much completion suggestions on an empty string.
> 
> Is there a case where it would actually make sense? Specifically in
> virsh we almost always accept id/name/UUID interchangably for a
> 'domain'.
> 

As I'm saying in the commit message - virt-viewer accepts --id, I don't 
expect ID completer to ever be implemented for virsh because as you say, 
domnames and/or uuids are accepted universally.

But adapting virt-viewer's completer is not going to be trivial anyway, 
so we might as well drop this :-)

Michal




More information about the libvir-list mailing list