Skip to content

Commit

Permalink
Merge pull request #6028 from nanli1/fix_maxvcpu_num_in_new_version
Browse files Browse the repository at this point in the history
fix maxvcpu num due to qemu update
  • Loading branch information
chloerh authored Dec 2, 2024
2 parents fcf104d + 7382b76 commit ceeb822
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions libvirt/tests/cfg/cpu/max_vcpus.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
report_num_q35_7_8 = "384"
report_num_q35_8_3 = "512"
report_num_q35_8_4 = "710"
report_num_q35_9_6 = "4096"
- positive_test:
status_error = "no"
variants:
Expand Down
24 changes: 11 additions & 13 deletions libvirt/tests/src/cpu/max_vcpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def set_iommu(vmxml, **dargs):
report_num_q35_7_8 = params.get('report_num_q35_7_8', '')
report_num_q35_8_3 = params.get('report_num_q35_8_3', '')
report_num_q35_8_4 = params.get('report_num_q35_8_4', '')
report_num_q35_9_6 = params.get('report_num_q35_9_6', '')
logging.info('Check the output of virsh capabilities')
xmltreefile = capability_xml.CapabilityXML().xmltreefile
machtype_vcpunum_dict = {}
Expand All @@ -108,25 +109,22 @@ def set_iommu(vmxml, **dargs):
.format(report_num_pc_7,
machtype_vcpunum_dict[key]))
if key.startswith('pc-q35') or key == 'q35':
exp_val = report_num_q35_7_8
if key == "pc-q35-rhel7.3.0":
if machtype_vcpunum_dict[key] != report_num_q35_73:
test.fail('Test failed as q35_rhel73_max_vcpus_num '
'in virsh_capa is wrong. Expected: {} '
'Actual: {}.'
.format(report_num_q35_73,
machtype_vcpunum_dict[key]))
exp_val = report_num_q35_73
elif key == "pc-q35-rhel9.6.0" or key == 'q35':
exp_val = report_num_q35_9_6
else:
exp_val = report_num_q35_7_8
if libvirt_version.version_compare(7, 0, 0):
exp_val = report_num_q35_8_4
elif libvirt_version.version_compare(6, 6, 0):
exp_val = report_num_q35_8_3
if machtype_vcpunum_dict[key] != exp_val:
test.fail('Test failed as the q35_max_vcpus_num in '
'virsh_capa is wrong. Expected: {} '
'Actual: {}.'
.format(exp_val,
machtype_vcpunum_dict[key]))
if machtype_vcpunum_dict[key] != exp_val:
test.fail('Test failed as the q35_max_vcpus_num for'
' machine type:{} in virsh_capa is wrong.'
' Expected: {}, Actual: {}.'
.format(key, exp_val,
machtype_vcpunum_dict[key]))

# Test i440fx VM starts with 240(positive)/241(negative) vcpus and hot-plugs vcpus to 240
if check.startswith('i440fx_test'):
Expand Down

0 comments on commit ceeb822

Please sign in to comment.