libvirt/src/conf
Daniel Henrique Barboza 2020c6af8a conf, qemu: consider available CPUs in vcpupin/emulatorpin output
The output of vcpupin and emulatorpin for a domain with vcpu
placement='static' is based on a default bitmap that contains
all possible CPUs in the host, regardless of the CPUs being offline
or not. E.g. for a Linux host with this CPU setup (from lscpu):

On-line CPU(s) list:   0,8,16,24,32,40,(...),184
Off-line CPU(s) list: 1-7,9-15,17-23,25-31,(...),185-191

And a domain with this configuration:

  <vcpu placement='static'>1</vcpu>

'virsh vcpupin' will return the following:

$ sudo ./run tools/virsh vcpupin vcpupin_test
 VCPU   CPU Affinity
----------------------
 0      0-191

This is benign by its own, but can make the user believe that all
CPUs from the 0-191 range are eligible for pinning. Which can lead
to situations like this:

$ sudo ./run tools/virsh vcpupin vcpupin_test 0 1
error: Invalid value '1' for 'cpuset.cpus': Invalid argument

This is exarcebated by the fact that 'virsh vcpuinfo' considers only
available host CPUs in the 'CPU Affinity' field:

$ sudo ./run tools/virsh vcpuinfo vcpupin_test
(...)
CPU Affinity:   y-------y-------y-------(...)

This patch changes the default bitmap of vcpupin and emulatorpin, in
the case of domains with static vcpu placement, to all available CPUs
instead of all possible CPUs. Aside from making it consistent with
the behavior of 'vcpuinfo', users will now have one less incentive to
try to pin a vcpu in an offline CPU.

https://bugzilla.redhat.com/show_bug.cgi?id=1434276

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-08 19:39:44 +02:00
..
backup_conf.c backup: Allow configuring incremental backup per-disk individually 2020-07-08 08:40:30 +02:00
backup_conf.h backup: Allow configuring incremental backup per-disk individually 2020-07-08 08:40:30 +02:00
capabilities.c virsh: include virutil.h where used 2020-02-24 23:15:50 +01:00
capabilities.h Add a space before ending a comment 2020-01-30 12:32:03 +01:00
checkpoint_conf.c conf: checkpoint: Add a flag storing whether disk 'size' is valid 2020-07-07 12:58:19 +02:00
checkpoint_conf.h conf: checkpoint: Add a flag storing whether disk 'size' is valid 2020-07-07 12:58:19 +02:00
cpu_conf.c numa_conf: Drop CPU from name of two functions 2020-07-08 12:05:24 +02:00
cpu_conf.h conf: Introduce migratable attribute for the <cpu> element 2020-06-09 20:32:50 +02:00
device_conf.c qemu: move ZPCI uid validation into device validation 2020-06-26 18:53:51 +02:00
device_conf.h Remove virutil.h from all header files 2020-02-24 23:15:50 +01:00
domain_addr.c conf: fix zPCI address auto-generation on s390 2020-06-26 18:53:51 +02:00
domain_addr.h qemu/conf: set HOTPLUGGABLE connect flag during PCI address set init 2020-04-12 22:39:51 -04:00
domain_audit.c conf, qemu, security, tests: introducing 'def->tpms' array 2020-06-23 17:27:50 +02:00
domain_audit.h
domain_capabilities.c conf: Advertise migratable attribute for CPU in domcaps 2020-06-09 20:32:50 +02:00
domain_capabilities.h conf: Advertise migratable attribute for CPU in domcaps 2020-06-09 20:32:50 +02:00
domain_conf.c conf, qemu: consider available CPUs in vcpupin/emulatorpin output 2020-07-08 19:39:44 +02:00
domain_conf.h conf, qemu, security, tests: introducing 'def->tpms' array 2020-06-23 17:27:50 +02:00
domain_event.c conf: remove NULL check from virDomainQemuMonitorEventNew 2019-11-21 12:44:23 +01:00
domain_event.h conf: remove NULL check from virDomainQemuMonitorEventNew 2019-11-21 12:44:23 +01:00
domain_nwfilter.c conf: use g_strdup instead of VIR_STRDUP 2019-10-21 12:51:56 +02:00
domain_nwfilter.h
interface_conf.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
interface_conf.h Remove virutil.h from all header files 2020-02-24 23:15:50 +01:00
Makefile.inc.am backup: Parse and output backup XML 2019-12-10 12:41:56 +01:00
moment_conf.c src: replace clock_gettime()/gettimeofday() with g_get_real_time() 2020-01-03 15:42:13 +00:00
moment_conf.h
netdev_bandwidth_conf.c conf: do not pass vm object to virDomainClearNetBandwidth 2020-02-25 17:50:47 +01:00
netdev_bandwidth_conf.h conf: do not pass vm object to virDomainClearNetBandwidth 2020-02-25 17:50:47 +01:00
netdev_vlan_conf.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
netdev_vlan_conf.h
netdev_vport_profile_conf.c conf: return a const from virDomainNetGetActualVirtPortProfile 2019-11-25 15:29:56 -05:00
netdev_vport_profile_conf.h conf: return a const from virDomainNetGetActualVirtPortProfile 2019-11-25 15:29:56 -05:00
network_conf.c use g_autoptr for all xmlBuffers 2020-07-04 23:50:38 -04:00
network_conf.h conf: convert network_conf.c to use g_auto* pointers 2020-06-15 16:02:16 -04:00
network_event.c
network_event.h
networkcommon_conf.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
networkcommon_conf.h
node_device_conf.c nodedev: store mdev UUID in mdev caps 2020-06-19 10:39:55 +02:00
node_device_conf.h nodedev: store mdev UUID in mdev caps 2020-06-19 10:39:55 +02:00
node_device_event.c
node_device_event.h
node_device_util.c virsh: include virutil.h where used 2020-02-24 23:15:50 +01:00
node_device_util.h
numa_conf.c qemu: Build HMAT command line 2020-07-08 12:05:24 +02:00
numa_conf.h numa: expose HMAT APIs 2020-07-08 12:05:24 +02:00
nwfilter_conf.c src: Fix boolean assignment 2020-05-05 13:08:57 +02:00
nwfilter_conf.h
nwfilter_ipaddrmap.c conf: use g_strdup instead of VIR_STRDUP 2019-10-21 12:51:56 +02:00
nwfilter_ipaddrmap.h
nwfilter_params.c conf: remove unneeded labels 2020-01-07 16:40:41 +01:00
nwfilter_params.h
object_event_private.h conf: fix alignment in virObjectEvent to be 8 not 4 bytes 2020-06-04 11:17:05 +01:00
object_event.c conf: use g_strdup instead of VIR_STRDUP 2019-10-21 12:51:56 +02:00
object_event.h
secret_conf.c util: buffer: Remove virBufferCheckError 2019-10-24 19:35:34 +02:00
secret_conf.h Remove virutil.h from all header files 2020-02-24 23:15:50 +01:00
secret_event.c
secret_event.h
snapshot_conf_priv.h
snapshot_conf.c conf: snapshot: Drop unused variable 'creation' 2020-06-11 09:30:18 +02:00
snapshot_conf.h src: replace verify(expr) with G_STATIC_ASSERT(expr) 2020-01-17 10:02:01 +00:00
storage_adapter_conf.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
storage_adapter_conf.h
storage_capabilities.c conf: storagecaps: Fix broken attempt at being const-correct 2019-11-12 14:37:57 +01:00
storage_capabilities.h conf: storagecaps: Fix broken attempt at being const-correct 2019-11-12 14:37:57 +01:00
storage_conf.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
storage_conf.h Add a space before ending a comment 2020-01-30 12:32:03 +01:00
storage_event.c
storage_event.h
virchrdev.c virchrdev: Drop needless 'cleanup' label in virChrdevLockFileCreate() 2020-01-16 14:13:47 +01:00
virchrdev.h
virconftypes.h backup: Parse and output backup XML 2019-12-10 12:41:56 +01:00
virdomaincheckpointobjlist.c src: replace verify(expr) with G_STATIC_ASSERT(expr) 2020-01-17 10:02:01 +00:00
virdomaincheckpointobjlist.h
virdomainmomentobjlist.c util: consolidate on one free callback for hash data 2019-11-22 14:21:28 +00:00
virdomainmomentobjlist.h
virdomainobjlist.c conf: drop virCapsPtr param from domain obj list APIs 2019-12-09 10:17:27 +00:00
virdomainobjlist.h conf: drop virCapsPtr param from domain obj list APIs 2019-12-09 10:17:27 +00:00
virdomainsnapshotobjlist.c Use G_N_ELEMENTS instead of ARRAY_CARDINALITY 2019-10-15 16:14:19 +02:00
virdomainsnapshotobjlist.h
virinterfaceobj.c conf: use g_strdup instead of VIR_STRDUP 2019-10-21 12:51:56 +02:00
virinterfaceobj.h
virnetworkobj.c conf: fix use after free 2020-02-24 17:24:49 +00:00
virnetworkobj.h Use G_GNUC_WARN_UNUSED_RESULT instead of ATTRIBUTE_RETURN_CHECK 2019-10-15 11:25:22 +02:00
virnetworkportdef.c Drop needless variable 2020-05-05 11:19:34 +02:00
virnetworkportdef.h conf: reduce includes in virnetworkportdef.h 2020-02-25 17:50:47 +01:00
virnodedeviceobj.c nodedev: add mdev support to virNodeDeviceCreateXML() 2020-06-19 10:39:55 +02:00
virnodedeviceobj.h nodedev: add mdev support to virNodeDeviceCreateXML() 2020-06-19 10:39:55 +02:00
virnwfilterbindingdef.c util: buffer: Remove virBufferCheckError 2019-10-24 19:35:34 +02:00
virnwfilterbindingdef.h conf: virnwfilterbindingdef: include virxml.h 2020-02-25 17:46:45 +01:00
virnwfilterbindingobj.c virsh: include virutil.h where used 2020-02-24 23:15:50 +01:00
virnwfilterbindingobj.h
virnwfilterbindingobjlist.c conf: use G_GNUC_UNUSED 2019-10-15 11:25:22 +02:00
virnwfilterbindingobjlist.h
virnwfilterobj.c conf: use g_strdup instead of VIR_STRDUP 2019-10-21 12:51:56 +02:00
virnwfilterobj.h
virsavecookie.c Use more of VIR_XPATH_NODE_AUTORESTORE 2020-06-03 21:06:02 +02:00
virsavecookie.h
virsecretobj.c conf: remove unneeded cleanup labels 2019-11-12 17:54:01 +01:00
virsecretobj.h
virstorageobj.c Unlock the storage pool objects after looking it up 2020-05-18 11:31:58 +02:00
virstorageobj.h