-
Notifications
You must be signed in to change notification settings - Fork 182
qemu_guest_agent: Add new api support 'guest-get-load' #4309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1a6487d
to
c9269f4
Compare
for linux guest: |
5ca1445
to
fd0cfe1
Compare
For Window VM: |
@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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
qemu/tests/qemu_guest_agent.py
Outdated
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"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]>
7a7c8c3
to
f8a677b
Compare
Linux could be passed normally, Windows still has to adjust a little. |
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]