Skip to content

Conversation

6-dehan
Copy link
Contributor

@6-dehan 6-dehan commented May 14, 2025

Add a new guest agent command 'guest-get-load' to
get cpu load average info of Guest.

ID: 3534
Signed-off-by: Dehan Meng [email protected]

@6-dehan 6-dehan force-pushed the KVMAUTOMA-3534-cpuload branch 7 times, most recently from 1a6487d to c9269f4 Compare May 15, 2025 08:02
@6-dehan
Copy link
Contributor Author

6-dehan commented May 15, 2025

for linux guest:
(1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.7.0.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.check_get_load.q35: PASS (165.03 s)

@6-dehan 6-dehan force-pushed the KVMAUTOMA-3534-cpuload branch 3 times, most recently from 5ca1445 to fd0cfe1 Compare May 16, 2025 04:45
@6-dehan
Copy link
Contributor Author

6-dehan commented May 16, 2025

For Window VM:
(1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.check_get_load.q35: PASS (143.49 s)

@6-dehan
Copy link
Contributor Author

6-dehan commented May 16, 2025

@leidwang Could you please help to review this when you're free?

# Start CPU stress test
error_context.context("Start CPU stress test", LOG_JOB.info)
session.cmd(params["cmd_run_stress"])
time.sleep(10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @6-dehan
I saw you added some time.sleep to wait for the process to start or terminate, I'm worried it will introduce some failures in the future, is it possible to check the process status directly instead of time.sleep?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @leidwang
I tried to detect the running status, but it is not enough to just have the running status. In the end, we still need to run the stress command for a while to let the stress value rise to meet our expectations. And it is just a simple stress test command. time.sleep is enough to deal with it. There is no need to make it too complicated.

except (KeyError, ValueError) as e:
test.error(f"Failed to get QGA load stats: {e}")

def _verify_load_values(qga_vals, guest_vals, check_type="match"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _verify_load_values(qga_vals, guest_vals, check_type="match"):
def _verify_load_values(qga_vals, guest_vals, check_type="match", prev_values=None):

Add a new guest agent command 'guest-get-load' to
get cpu load average info of Guest.

Signed-off-by: Dehan Meng <[email protected]>
@6-dehan 6-dehan force-pushed the KVMAUTOMA-3534-cpuload branch from 7a7c8c3 to f8a677b Compare August 21, 2025 03:44
@6-dehan
Copy link
Contributor Author

6-dehan commented Sep 1, 2025

Linux could be passed normally, Windows still has to adjust a little.
(3/4) Host_RHEL.m10.u1.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.1.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.check_get_load.q35: PASS (136.85 s)

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.

2 participants