Bug 2137804

Summary: Inconsistent error msg prompts when setting inexistent nodeset with restrictive numa tuning mode
Product: Red Hat Enterprise Linux 9 Reporter: liang cong <lcong>
Component: libvirtAssignee: khanicov
libvirt sub component: General QA Contact: liang cong <lcong>
Status: CLOSED DUPLICATE Docs Contact:
Severity: low    
Priority: medium CC: abologna, lmen, mprivozn, virt-maint, xuzhang
Version: 9.1Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-16 10:50:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description liang cong 2022-10-26 09:29:46 UTC
Description of problem:
Inconsistent error msg prompts when setting inexistent nodeset with restrictive numa tuning mode

Version-Release number of selected component (if applicable):
# rpm -q libvirt qemu-kvm
libvirt-8.5.0-7.el9_1.x86_64
qemu-kvm-7.0.0-13.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.There are 2 numa nodes on host:
# numactl --hard
available: 2 nodes (0-1)
node 0 cpus: 0 1
node 0 size: 3671 MB
node 0 free: 1731 MB
node 1 cpus: 2 3
node 1 size: 4020 MB
node 1 free: 2215 MB
node distances:
node   0   1 
  0:  10  20 
  1:  20  10 

2.Set numa tuning with restrictive mode and inexistent numa nodeset 2
<numatune>
<memory mode='restrictive' nodeset='2'/>
</numatune>

3.Start the guest vm
# virsh start vm1
error: Failed to start domain 'vm1'
error: Invalid value '2' for 'cpuset.mems': Invalid argument

Actual results:
Error msg prompts:
error: Invalid value '2' for 'cpuset.mems': Invalid argument


Expected results:
If setting other numa tuning mode like "" then the error msg is:
error: unsupported configuration: NUMA node 2 is unavailable

The error msg should keep consistent. 


Additional info:
If setting numa topology like:
<numa>
   <cell id="0" cpus="0-1" memory="2097152" unit="KiB"/>
</numa>
then the error msg is consistent as "error: unsupported configuration: NUMA node 2 is unavailable", no matter what mode is set.

Comment 1 liang cong 2022-10-26 09:43:22 UTC
Add some info:
If setting other numa tuning mode like "preferred", "strict" or "interleave" then the error msg is:
error: unsupported configuration: NUMA node 2 is unavailable

Comment 2 Michal Privoznik 2022-10-26 09:47:36 UTC
This is because the check for host NUMA nodes presence is skipped in qemuBuildMemoryBackendProps() for VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE and then the code proceeds to qemuProcessSetupPid() where the nodeset is set directly in CGroups, hence the difference in error messages.

Comment 3 Andrea Bolognani 2023-01-16 10:50:47 UTC

*** This bug has been marked as a duplicate of bug 2156289 ***