libvirt/tools
Lin Ma 093eed7360 virsh: Fix completion logic to guestvcpus command
In case of non-continuous vCPU topology, We can't infer the bitmap size
from the combination of onlineVcpuStr and nvcpus.
We should use virBitmapParseUnlimited here instead of virBitmapParse due
to the bitmap size is unknown.

e.g.:

  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
    <vcpu id='2' enabled='yes' hotpluggable='yes' order='3'/>
    <vcpu id='3' enabled='yes' hotpluggable='yes' order='4'/>
    <vcpu id='4' enabled='yes' hotpluggable='yes' order='5'/>
    <vcpu id='5' enabled='yes' hotpluggable='yes' order='6'/>
    <vcpu id='6' enabled='no' hotpluggable='yes'/>
    <vcpu id='7' enabled='no' hotpluggable='yes'/>
  </vcpus>

 # virsh guestvcpus --domain VM
vcpus          : 0-5
online         : 0-5
offlinable     : 1-5

 # virsh setvcpu --domain VM --disable --vcpulist 2

 # virsh guestvcpus --domain VM --disable --cpulist 4,5

 # virsh guestvcpus --domain VM
vcpus          : 0-1,3-5
online         : 0-1,3
offlinable     : 1,3-5

Before:
 # virsh guestvcpus --domain VM --enable --cpulist <TAB><TAB>
2  4

After:
 # virsh guestvcpus --domain VM --enable --cpulist <TAB><TAB>
4  5

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-04-22 13:46:48 +02:00
..
bash-completion tools: Generate per-command bash completion script 2021-04-22 11:01:27 +02:00
nss meson: Fix build with -Dtest_coverage=true 2021-01-19 16:25:50 +01:00
wireshark Remove references to deleted Makefile.am 2021-04-13 11:21:00 +02:00
libvirt_recover_xattrs.sh tools: Fix dry run of libvirt_recover_xattrs.sh 2021-03-02 09:42:38 +01:00
libvirt_win_icon_16x16.ico
libvirt_win_icon_32x32.ico
libvirt_win_icon_48x48.ico
libvirt_win_icon_64x64.ico
libvirt-guests.service.in
libvirt-guests.sh.in
libvirt-guests.sysconf libvirt-guests: Remove obsolete Windows comment 2020-12-07 10:38:44 +00:00
meson.build Fix spelling 2021-04-15 15:42:21 +02:00
virsh_win_icon.rc
virsh-backup.c
virsh-backup.h
virsh-checkpoint.c virshCheckpointListCollect: Do not pass NULL to qsort 2021-04-19 16:09:56 -04:00
virsh-checkpoint.h
virsh-completer-checkpoint.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-checkpoint.h
virsh-completer-domain.c virsh: Fix completion logic to guestvcpus command 2021-04-22 13:46:48 +02:00
virsh-completer-domain.h virsh: Add mountpoint completion to domfsfreeze/domfsthaw command 2021-04-22 13:46:44 +02:00
virsh-completer-host.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-host.h virsh: Add logical CPU IDs completion for nodecpustats command 2020-11-10 18:34:02 +01:00
virsh-completer-interface.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-interface.h virsh: Add interface mac completion to iface-name command 2020-11-10 18:34:11 +01:00
virsh-completer-network.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-network.h virsh: Add mac completion to net-dhcp-leases command 2020-11-10 18:34:23 +01:00
virsh-completer-nodedev.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-nodedev.h
virsh-completer-nwfilter.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-nwfilter.h
virsh-completer-pool.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-pool.h
virsh-completer-secret.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-secret.h
virsh-completer-snapshot.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-snapshot.h
virsh-completer-volume.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-completer-volume.h
virsh-completer.c Replace virStringSplit with g_strsplit 2021-02-11 17:05:34 +01:00
virsh-completer.h
virsh-console.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-console.h
virsh-domain-monitor.c cmdDomBlkError: Fix crash when initial call to virDomainGetDiskErrors fails 2021-04-19 11:04:53 +02:00
virsh-domain-monitor.h
virsh-domain.c virsh: Add mountpoint completion to domfsfreeze/domfsthaw command 2021-04-22 13:46:44 +02:00
virsh-domain.h virsh: Move/add some of function declarations to virsh-domain.h 2020-11-10 18:34:26 +01:00
virsh-edit.c
virsh-host.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-host.h
virsh-interface.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-interface.h
virsh-network.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-network.h
virsh-nodedev.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-nodedev.h
virsh-nwfilter.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-nwfilter.h
virsh-pool.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-pool.h
virsh-secret.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-secret.h
virsh-snapshot.c cmdSnapshotList: Fix memory leak 2021-04-19 16:09:56 -04:00
virsh-snapshot.h
virsh-util.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-util.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-volume.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh-volume.h
virsh.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virsh.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-admin-completer.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-admin-completer.h
virt-admin.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-admin.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-host-validate-bhyve.c
virt-host-validate-bhyve.h
virt-host-validate-common.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-host-validate-common.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-host-validate-lxc.c
virt-host-validate-lxc.h
virt-host-validate-qemu.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virt-host-validate-qemu.h
virt-host-validate.c
virt-login-shell-helper.c Replace AbsPath judgement method with g_path_is_absolute() 2021-04-21 10:02:09 +02:00
virt-login-shell.c
virt-login-shell.conf
virt-pki-validate.in
virt-sanlock-cleanup.in
virt-xml-validate.in
vsh-table.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
vsh-table.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
vsh.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
vsh.h vsh: Rework how option to complete is found 2021-01-26 16:46:41 +01:00