Skip to content

The patch fixes most of the failures from libvirt_mem - #6035

Open
TasmiyaNalatwad wants to merge 1 commit into
autotest:masterfrom
TasmiyaNalatwad:libvirt_mem_fixes
Open

TasmiyaNalatwad wants to merge 1 commit into
autotest:masterfrom
TasmiyaNalatwad:libvirt_mem_fixes

Conversation

@TasmiyaNalatwad

@TasmiyaNalatwad TasmiyaNalatwad commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

Based on the test requirements adding/modifying some of the cfg values to make the guest run and flexibly test the scenarios.

Summary by CodeRabbit

  • Bug Fixes

    • Fix memory calculation/validation on PPC64/PPC64LE by using NUMA-aware totals to prevent misreported current/max memory.
    • Improve memory alignment on PPC64LE by enforcing a safe minimum per NUMA cell to reduce rounding issues in domain configs.
  • Tests

    • Add PPC64/PPC64LE-specific overrides for memory test variants to stabilize max-memory and hugepage parameters.
    • Adjust repeated-attach test limits for greater reliability on PPC.

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

There are few failures in this set of tests which require some other fix, which will be taken up as other task and fixed.
The tests were failing as VM was getting dead and not able to login to the guest, after debugging i understood that the memory guest was assigned to boot was very less (524288Kib to one node) 1Gib total as guest was having just 2 nodes, hence the guest booting was failing with OOM call traces, after increasing the memory on each node from 524288Kb to 1048576Kb the guest booted up. To handle all the other scenarios based on 1G memory size other changes have been done,

Previous results

(125/430) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native: STARTED
 (125/430) io-github-autotest-qemu.unattended_install.import.import.default_install.aio_native:  PASS (67.20 s)
 (126/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.default: STARTED
 (126/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.default:  PASS (81.24 s)
 (127/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.cold_plug_discard: STARTED
 (127/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.cold_plug_discard:  PASS (64.03 s)
 (128/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.discard: STARTED
 (128/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.discard:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (289.53 s)
 (129/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.default: STARTED
 (129/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.default:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.33 s)
 (130/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.without_reboot: STARTED
 (130/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.without_reboot:  PASS (161.18 s)
 (131/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.with_rand_reboot: STARTED
 (131/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.with_rand_reboot:  PASS (631.27 s)
 (132/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.default: STARTED
 (132/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.default:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.12 s)
 (133/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.without_reboot: STARTED
 (133/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.without_reboot:  FAIL: error: Failed to detach device from /var/tmp/xml_utils_temp_t6sclph2.xml\nerror: operation failed: unplug of device was rejected by the guest\n (166.71 s)
 (134/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.with_rand_reboot: STARTED
 (134/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.with_rand_reboot:  FAIL: error: Failed to detach device from /var/tmp/xml_utils_temp_wmid5_ne.xml\nerror: operation failed: unplug of device was rejected by the guest\n (615.55 s)
 (135/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.default: STARTED
 (135/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.default:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.33 s)
 (136/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.without_reboot: STARTED
 (136/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.without_reboot:  PASS (91.44 s)
 (137/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.with_rand_reboot: STARTED
 (137/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.with_rand_reboot:  PASS (523.80 s)
 (138/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.default: STARTED
 (138/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.default:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.41 s)
 (139/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.without_reboot: STARTED
 (139/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.without_reboot:  PASS (107.18 s)
 (140/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.with_rand_reboot: STARTED
 (140/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.with_rand_reboot:  PASS (532.15 s)
 (141/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.detach_device_alias.default: STARTED
 (141/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.detach_device_alias.default:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.59 s)
 (142/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.no_attach: STARTED
 (142/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.no_attach:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (288.71 s)
 (143/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.without_numa_save_restore: STARTED
 (143/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.without_numa_save_restore:  ERROR: Failed to define virt-tests-vm1 for reason:\nerror: Failed to define domain from /var/tmp/xml_utils_temp_evxs1db4.xml\nerror: unsupported configuration: target NUMA node needs to be specified for memory device\n (4.38 s)
 (144/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.cold_plug: STARTED
 (144/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.cold_plug:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (288.63 s)
 (145/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.hot_plug: STARTED
 (145/430) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.hot_plug:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.71 s)
 (146/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_slot: STARTED
 (146/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_slot:  PASS (4.99 s)
 (147/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_address: STARTED
 (147/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_address:  PASS (6.39 s)
 (148/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_vm_node: STARTED
 (148/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_vm_node:  PASS (5.02 s)
 (149/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_host_node: STARTED
 (149/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_host_node:  PASS (4.20 s)
 (150/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_invalid_type: STARTED
 (150/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_invalid_type:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.19 s)
 (151/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_duplicate_node: STARTED
 (151/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_duplicate_node:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.16 s)
 (152/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_many_times: STARTED
 (152/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_many_times:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.06 s)
 (153/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_gt_max: STARTED
 (153/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_gt_max:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.38 s)
 (154/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_type: STARTED
 (154/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_type:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (244.85 s)
 (155/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_duplicate_node: STARTED
 (155/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_duplicate_node:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.04 s)
 (156/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_many_times: STARTED
 (156/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_many_times:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (244.97 s)
 (157/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_size: STARTED
 (157/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_size:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.38 s)
 (158/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.setmem_error.with_numa: STARTED
 (158/430) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.setmem_error.with_numa:  ERROR: Login timeout expired    (output: 'exceeded 240 s timeout, last failure: No ipv4 DHCP lease for MAC 52:54:00:7d:69:10') (245.21 s)

The results after patch applied are below

JOB ID     : 37d03a4370b59d0f348ccb33ca9cd2bd79f8facd
JOB LOG    : /root/tests/results/job-2024-12-02T08.53-37d03a4/job.log
 (01/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.default: STARTED
 (01/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.default:  PASS (69.12 s)
 (02/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.cold_plug_discard: STARTED
 (02/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.cold_plug_discard:  PASS (69.44 s)
 (03/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.discard: STARTED
 (03/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.mem_basic.discard:  PASS (91.22 s)
 (04/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.default: STARTED
 (04/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.default:  PASS (95.32 s)
 (05/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.without_reboot: STARTED
 (05/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.without_reboot:  PASS (159.52 s)
 (06/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.with_rand_reboot: STARTED
 (06/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.plug.max_slots.with_rand_reboot:  PASS (621.41 s)
 (07/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.default: STARTED
 (07/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.default:  FAIL: error: Failed to detach device from /var/tmp/xml_utils_temp_t3j6cqqk.xml\nerror: operation failed: unplug of device was rejected by the guest\n (107.51 s)
 (08/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.without_reboot: STARTED
 (08/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.without_reboot:  PASS (179.41 s)
 (09/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.with_rand_reboot: STARTED
 (09/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.max_slots.with_rand_reboot:  PASS (655.00 s)
 (10/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.default: STARTED
 (10/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.default:  PASS (68.65 s)
 (11/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.without_reboot: STARTED
 (11/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.without_reboot:  PASS (91.69 s)
 (12/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.with_rand_reboot: STARTED
 (12/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.plug.max_slots.with_rand_reboot:  PASS (555.70 s)
 (13/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.default: STARTED
 (13/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.default:  PASS (70.11 s)
 (14/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.without_reboot: STARTED
 (14/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.without_reboot:  PASS (104.05 s)
 (15/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.with_rand_reboot: STARTED
 (15/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.unplug.max_slots.with_rand_reboot:  PASS (534.06 s)
 (16/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.detach_device_alias.default: STARTED
 (16/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.cold.detach_device_alias.default:  PASS (70.83 s)
 (17/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.no_attach: STARTED
 (17/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.no_attach:  PASS (68.46 s)
 (18/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.without_numa_save_restore: STARTED
 (18/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.without_numa_save_restore:  ERROR: Failed to define avocado-vt-vm1 for reason:\nerror: Failed to define domain from /var/tmp/xml_utils_temp_hrhc09gg.xml\nerror: unsupported configuration: target NUMA node needs to be specified for memory device\n (3.86 s)
 (19/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.cold_plug: STARTED
 (19/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.cold_plug:  FAIL: Qemu command check fail. (24.59 s)
 (20/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.hot_plug: STARTED
 (20/33) type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.hot_plug:  FAIL: Qemu command check fail. (31.18 s)
 (21/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_slot: STARTED
 (21/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_slot:  PASS (4.41 s)
 (22/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_address: STARTED
 (22/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_address:  PASS (5.12 s)
 (23/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_vm_node: STARTED
 (23/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_vm_node:  PASS (4.29 s)
 (24/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_host_node: STARTED
 (24/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.start_error.invalid_host_node:  PASS (4.20 s)
 (25/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_invalid_type: STARTED
 (25/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_invalid_type:  PASS (25.65 s)
 (26/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_duplicate_node: STARTED
 (26/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_duplicate_node:  PASS (26.50 s)
 (27/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_many_times: STARTED
 (27/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_many_times:  PASS (25.54 s)
 (28/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_gt_max: STARTED
 (28/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.attach_error.attach_gt_max:  PASS (57.20 s)
 (29/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_type: STARTED
 (29/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_type:  PASS (25.67 s)
 (30/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_duplicate_node: STARTED
 (30/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_duplicate_node:  PASS (25.76 s)
 (31/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_many_times: STARTED
 (31/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_many_times:  PASS (27.84 s)
 (32/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_size: STARTED
 (32/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.detach_error.detach_invalid_size:  PASS (25.27 s)
 (33/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.setmem_error.with_numa: STARTED
 (33/33) type_specific.io-github-autotest-libvirt.libvirt_mem.negative_test.setmem_error.with_numa:  PASS (24.58 s)
RESULTS    : PASS 29 | ERROR 1 | FAIL 3 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /root/tests/results/job-2024-12-02T08.53-37d03a4/results.html
JOB TIME   : 4236.68 s

Test summary:
07-type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.memory.hot.unplug.default: FAIL
18-type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.without_numa_save_restore: ERROR
19-type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.cold_plug: FAIL
20-type_specific.io-github-autotest-libvirt.libvirt_mem.positive_test.align_256m.hot_plug: FAIL
10:04:17 INFO    : 
10:04:17 INFO    : Summary of test results can be found below:
TestSuite                                                                                 TestRun    Summary
 
guest_memory_copy                                                                         Run        Successfully executed
/root/tests/results/job-2024-12-02T08.53-37d03a4/job.log
| PASS 29 || CANCEL 0 || ERRORS 1 || FAILURES 3 || SKIP 0 || WARN 0 || INTERRUPT 0 |
10:04:17 INFO    : Removing temporary mux dir

@chloerh chloerh closed this Jan 23, 2025
@chloerh chloerh reopened this Jan 23, 2025

@PraveenPenguin PraveenPenguin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread libvirt/tests/cfg/libvirt_mem.cfg Outdated
Comment thread libvirt/tests/cfg/libvirt_mem.cfg Outdated
@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@chunfuwen @chloerh @dzhengfy would you please review the changes and help me in proceeding with the PR merge.

Thank you

@coderabbitai

coderabbitai Bot commented Sep 10, 2025

Copy link
Copy Markdown

Walkthrough

Adds PPC64 and PPC64LE-specific memory configuration overrides in libvirt_mem.cfg and introduces architecture-aware handling in libvirt_mem.py: PPC sums NUMA-cell memory for checks and PPC64LE clamps per-NUMA-cell memory to ≥1 GiB before alignment. All config changes are additive; code changes are conditional on platform.machine().

Changes

Cohort / File(s) Summary of changes
PPC config overrides
libvirt/tests/cfg/libvirt_mem.cfg
Added ppc64 / ppc64le blocks to set max_mem_rt and tg_size in the top-level mem_online section and across multiple variants (mem_basic, nested memory variants, attach_times/attach_many_times). Only additive per-architecture overrides.
PPC-aware memory handling
libvirt/tests/src/libvirt_mem.py
In check_dom_xml, detect PPC (platform.machine() contains "ppc64") and use the sum of per-NUMA-cell memory for current/max memory checks. In modify_domain_xml, when align_mem_values is enabled and NUMA cells exist, detect "ppc64le" and clamp each NUMA-cell memory to at least 1 GiB (1048576 KiB) before applying alignment. No public API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant TR as Test Runner
  participant LM as libvirt_mem.py
  participant PM as platform.machine()
  participant XML as Domain XML / NUMA Cells

  TR->>LM: check_dom_xml()
  LM->>PM: machine()
  PM-->>LM: arch (e.g., ppc64le / other)
  LM->>XML: read domain memory and NUMA cell values
  alt arch contains "ppc64"
    note right of LM#dff0d8: Sum NUMA-cell memory for cur/max checks
  else
    note right of LM#f0f0d8: Use standard memory fields for checks
  end

  TR->>LM: modify_domain_xml(align_mem_values=...)
  LM->>PM: machine()
  PM-->>LM: arch
  LM->>XML: read per-NUMA-cell memory values
  alt align_mem_values enabled
    opt arch == "ppc64le"
      note right of LM#d8eff0: Clamp each cell to ≥1 GiB, then align
    end
    note right of LM#f0f0d8: Apply alignment to per-cell memory values
  end
  LM-->>TR: return updated/validated XML
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A bunny tweaks the memory fields with care,
Hops to PPC lands—numa cells everywhere!
Clamp a gig, align just right,
Configs bloom in ppc light.
With whiskers twitching, tests now run. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title reports that the patch fixes most libvirt_mem failures but does not indicate how those failures are resolved or what areas are affected. It omits mention of the specific configuration changes such as per-architecture memory overrides for PPC64/ppc64le and increased per-NUMA-node memory. As a result, the title is too generic to convey the core technical changes to teammates scanning the PR history. A clearer title could mention the key modifications, for instance by specifying the added PPC64/ppc64le memory overrides and the per-NUMA-node memory increase to 1 GiB that address test failures. This gives immediate context on the architectural and configuration adjustments. Updating the PR title to reflect these specifics will improve clarity and future traceability.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f63999b and 8514b6d.

📒 Files selected for processing (2)
  • libvirt/tests/cfg/libvirt_mem.cfg (3 hunks)
  • libvirt/tests/src/libvirt_mem.py (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Python 3.12
  • GitHub Check: Python 3.11
  • GitHub Check: Python 3.9
  • GitHub Check: Python 3.8
🔇 Additional comments (1)
libvirt/tests/cfg/libvirt_mem.cfg (1)

34-36: LGTM! PPC64/PPC64LE overrides align with PR objectives.

The architecture-specific configuration overrides appropriately increase memory values for PPC64 variants to address the OOM-induced boot failures described in the PR objectives:

  1. Lines 34-36: Top-level overrides set max_mem_rt=3145728 (3 GiB) and tg_size=1048576 (1 GiB), matching the goal of increasing per-NUMA-node memory from 512 MiB to 1 GiB.

  2. Lines 44-45: The mem_basic variant override ensures adequate maximum runtime memory (3 GiB) for PPC64 tests.

  3. Lines 65-66: The max_slots variant uses tg_size=524288 (512 MiB), which is lower than the top-level 1 GiB override. This appears intentional for testing with 255 memory device attachments, where smaller per-device size may be necessary.

  4. Lines 215-216: The attach_many_times variant sets max_mem_rt=3670016 (~3.5 GiB) to accommodate multiple attachment attempts.

All changes are additive and properly scoped to PPC64 architectures only.

Optionally verify that the lower tg_size=524288 at line 66 for the max_slots variant is intentional and doesn't cause the original OOM issue when attaching 255 devices. The configuration appears sound, but confirming this specific test case passes would be prudent.

Also applies to: 44-45, 65-66, 215-216


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libvirt/tests/src/libvirt_mem.py (1)

206-221: Refactor arch detection and guard NUMA cells in libvirt/tests/src/libvirt_mem.py (lines ~206–221)
Normalize arch via cpu_util.get_arch().lower() with a platform.machine().lower() fallback, and replace direct cpuxml.numa_cell access with a safe getattr guard and non‐empty check to avoid None or empty list errors.

-        arch = platform.machine()
+        # Normalize arch with cpu_util, fallback to platform.machine()
+        try:
+            arch = cpu_util.get_arch().lower()
+        except Exception:
+            arch = platform.machine().lower()
@@
-            numa_cells = cpuxml.numa_cell
-
-            if 'ppc64' in arch:
-                cur_mem = max_mem = sum(int(cell["memory"]) for cell in numa_cells)
+            numa_cells = getattr(cpuxml, "numa_cell", []) or []
+            if arch.startswith("ppc64") and numa_cells:
+                cur_mem = max_mem = sum(int(cell["memory"]) for cell in numa_cells)
🧹 Nitpick comments (1)
libvirt/tests/cfg/libvirt_mem.cfg (1)

66-67: Drop redundant override (same value already set).

tg_size is already 524288 at Line 62; repeating it under ppc64/ppc64le is unnecessary and increases maintenance.

Apply:

-                            ppc64,ppc64le:
-                                tg_size = 524288
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae482a9 and c3c2d63.

📒 Files selected for processing (2)
  • libvirt/tests/cfg/libvirt_mem.cfg (3 hunks)
  • libvirt/tests/src/libvirt_mem.py (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Python 3.11
  • GitHub Check: Python 3.8
  • GitHub Check: Python 3.12
  • GitHub Check: Python 3.9
🔇 Additional comments (4)
libvirt/tests/cfg/libvirt_mem.cfg (3)

34-36: Arch-specific overrides here look good.

Placing ppc64/ppc64le overrides under the variant block (without “only”) correctly narrows the changed keys to those arches without filtering out the whole variant for others.


44-46: mem_basic PPC overrides are appropriate.

Consistent with the top-level positive_test overrides; no issues spotted.


216-217: Reasonable PPC-specific bump for attach_many_times.

max_mem_rt=3670016 aligns with larger DIMM needs on ppc; OK.

libvirt/tests/src/libvirt_mem.py (1)

370-382: Refactor: broaden ppc match and simplify loop

-            arch = platform.machine()
-            min_memory_value = 1048576  # 1 GiB in KiB
+            try:
+                arch = cpu_util.get_arch().lower()
+            except Exception:
+                arch = platform.machine().lower()
+            min_memory_value = 1048576  # 1 GiB in KiB
@@
-                for cell in range(cells.__len__()):
-                    memory_value = int(cells[cell]["memory"])
-                    if arch == "ppc64le":
-                        memory_value = max(memory_value, min_memory_value)
-                    else:
-                        memory_value = memory_value
-                    cells[cell]["memory"] = str(utils_numeric.align_value(
-                        memory_value,
-                        align_to_value))
+                for idx, cell in enumerate(cells):
+                    memory_value = int(cell["memory"])
+                    if arch.startswith("ppc64"):
+                        memory_value = max(memory_value, min_memory_value)
+                    cells[idx]["memory"] = str(
+                        utils_numeric.align_value(memory_value, align_to_value)
+                    )

Consider making min_memory_value a config knob (e.g., ppc64_min_cell_mem) to avoid hardcoding.

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@chunfuwen @chloerh @dzhengfy May I request you all to please review the changes and let me know the inputs.

Thank you all

@hariharants

Copy link
Copy Markdown

@chunfuwen @chloerh @dzhengfy @luckyh Pleae review the patch. All review comments are been addressed.

@dzhengfy dzhengfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

Comment thread libvirt/tests/cfg/libvirt_mem.cfg Outdated
Comment thread libvirt/tests/cfg/libvirt_mem.cfg

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
libvirt/tests/src/libvirt_mem.py (3)

216-221: Move NUMA cell extraction inside the PPC64-specific conditional.

Lines 216-218 extract cpuxml and numa_cells unconditionally but only use them when 'ppc64' in arch. This creates unused variable assignments on non-PPC64 platforms.

Apply this diff to improve efficiency:

-        cpuxml = dom_xml.cpu
-        numa_cells = cpuxml.numa_cell
-
         if 'ppc64' in arch:
+            cpuxml = dom_xml.cpu
+            numa_cells = cpuxml.numa_cell
             cur_mem = max_mem = sum(int(cell["memory"]) for cell in numa_cells)

371-371: Move constant inside conditional scope.

min_memory_value is defined unconditionally on Line 371 but only used when arch == "ppc64le" (Line 377). Moving it inside the conditional improves clarity and avoids unnecessary assignments on non-PPC64LE platforms.

Apply this diff:

         cells = [ast.literal_eval(x) for x in numa_cells]
         arch = platform.machine()
-        min_memory_value = 1048576  # 1 GiB in KiB
         # Rounding the numa memory values
         if align_mem_values:
             for cell in range(cells.__len__()):
                 memory_value = int(cells[cell]["memory"])
                 if arch == "ppc64le":
+                    min_memory_value = 1048576  # 1 GiB in KiB
                     memory_value = max(memory_value, min_memory_value)

206-206: Consider caching platform detection result.

platform.machine() is called twice (Lines 206 and 370) in separate functions within the same test run. While this is not a performance concern, consider whether the architecture could be detected once at module level or passed as a parameter to improve consistency.

Example approach at module level:

# Near the top of the file after imports
HOST_ARCH = platform.machine().lower()

Then use HOST_ARCH in both functions. This ensures consistent detection across all test functions.

Also applies to: 370-370

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3c2d63 and f63999b.

📒 Files selected for processing (2)
  • libvirt/tests/cfg/libvirt_mem.cfg (2 hunks)
  • libvirt/tests/src/libvirt_mem.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libvirt/tests/cfg/libvirt_mem.cfg
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Python 3.8
  • GitHub Check: Python 3.9

Comment thread libvirt/tests/src/libvirt_mem.py Outdated
Comment thread libvirt/tests/src/libvirt_mem.py Outdated
Comment thread libvirt/tests/src/libvirt_mem.py Outdated
@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@dzhengfy Would you please review the changes made. Thank you!

@chunfuwen chunfuwen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@chunfuwen Thank you for the approval. Would you please help me in merging this PR

@harihare

harihare commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

As we have the approval can we merge this to tp-libvirt.

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@chunfuwen As we have the approval for this PR. Would you please help me in merging this PR.

Thanks in Advance.

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@luckyh @chunfuwen @dzhengfy Requesting to please help me merge this PR as i already have approval. Apologies for addressing again.

Thanks in Advance.

@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@luckyh @chunfuwen @dzhengfy Requesting to please help me merge this PR as i already have approval.

Thanks in Advance.

Comment thread libvirt/tests/src/libvirt_mem.py Outdated
@crobinso

Copy link
Copy Markdown
Collaborator

@TasmiyaNalatwad I do not think any of those users are involved in the project any longer. I can help with review.

Based on the test requirements adding/modifying some of the cfg values to make the guest run and flexibly test the scenarios.

Signed-off-by: Tasmiya Nalatwad <tasmiya@linux.vnet.ibm.com>
@TasmiyaNalatwad

Copy link
Copy Markdown
Contributor Author

@TasmiyaNalatwad I do not think any of those users are involved in the project any longer. I can help with review.

Thank you for your time, i have addressed review comments from coderabbitai and marked addressed ones as Resolved. Please have a look at this PR. TIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants