libvirt/tools
Peter Krempa 642261a866 virsh-domain: Refactor cmdVcpucount and fix output on inactive domains
This patch factors out the vCPU count retrieval including fallback means
into vshCPUCountCollect() and removes the duplicated code to retrieve
individual counts.

The --current flag (this flag is assumed by default) now works also with
--maximum or --active without the need to explicitly specify the state
of the domain that is requested.

This patch also fixes the output of "virsh vcpucount domain" on inactive
domains:

Before:
$ virsh vcpucount domain
maximum      config         4
error: Requested operation is not valid: domain is not running
current      config         4
error: Requested operation is not valid: domain is not running

After:
$virsh vcpucount domain
maximum      config         4
current      config         4

.. and for transient domains too:

Before:
$ virsh vcpucount transient-domain
error: Requested operation is not valid: cannot change persistent config of a transient domain
maximum      live           3
error: Requested operation is not valid: cannot change persistent config of a transient domain
current      live           1

After:
$ virsh vcpucount transient-domain
maximum      live           3
current      live           1
2013-04-19 14:02:10 +02:00
..
console.c
console.h
libvirt_win_icon_16x16.ico
libvirt_win_icon_32x32.ico
libvirt_win_icon_48x48.ico
libvirt_win_icon_64x64.ico
libvirt-guests.init.in tools: Only install guests init script if --with-init=script=redhat 2012-12-11 19:54:37 -05:00
libvirt-guests.service.in
libvirt-guests.sh.in libvirt-guests: newline between output sentences 2013-03-25 08:38:35 -06:00
libvirt-guests.sysconf
Makefile.am
virsh_win_icon.rc
virsh-domain-monitor.c
virsh-domain-monitor.h
virsh-domain.c virsh-domain: Refactor cmdVcpucount and fix output on inactive domains 2013-04-19 14:02:10 +02:00
virsh-domain.h
virsh-edit.c
virsh-host.c
virsh-host.h
virsh-interface.c
virsh-interface.h
virsh-network.c
virsh-network.h
virsh-nodedev.c
virsh-nodedev.h
virsh-nwfilter.c
virsh-nwfilter.h
virsh-pool.c
virsh-pool.h
virsh-secret.c
virsh-secret.h
virsh-snapshot.c
virsh-snapshot.h
virsh-volume.c
virsh-volume.h
virsh.c
virsh.h virsh: Introduce macros to reject mutually exclusive arguments 2013-03-21 12:32:03 +01:00
virsh.pod
virt-host-validate-common.c
virt-host-validate-common.h
virt-host-validate-lxc.c
virt-host-validate-lxc.h
virt-host-validate-qemu.c
virt-host-validate-qemu.h
virt-host-validate.c
virt-pki-validate.in
virt-sanlock-cleanup.in
virt-xml-validate.in