]> xenbits.xensource.com Git - libvirt.git/commit
virsh: fixing segfault by pool autocompleter function.
authorJulio Faracco <jcfaracco@gmail.com>
Wed, 28 Feb 2018 01:17:54 +0000 (22:17 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 28 Feb 2018 09:07:35 +0000 (10:07 +0100)
commit8fe09a53170a96962d6f795ff9b6034ff9d0fb7f
tree645fefa176defadee0e85325f6515cdf44b29ca5
parentf7399de11b9d92aa8e3a4c47c8cccd8de21db11a
virsh: fixing segfault by pool autocompleter function.

The commands which requires a pool to perform any action for a volume is
throwing a segfault when you pass the volume name before a pool name or
without the argument '--pool'.

An example that works:
virsh # vol-list loops-pool
 Name                 Path
-------------------------------------------------------------------
 loop0                /mnt/loop0

virsh # vol-info --pool loops-pool lo<TAB>

An example that does not work:
virsh # vol-list loops-pool
 Name                 Path
-------------------------------------------------------------------
 loop0                /mnt/loop0

virsh # vol-info lo<TAB>
Segmentation Fault

The example 'vol-info' can be executed as 'vol-info loop0 --pool
loops-pool'. So, this commit fixes this problem when the arguments are
inverted and avoids the segfault.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-pool.c