KVM: Add tdx_cpuoff_pinedVMdown case#571
Conversation
0cfe144 to
a5b2904
Compare
|
Now the booted vm should enabled with 64 cpus. |
| """ | ||
|
|
||
| for i in range(0, 20): | ||
| params["smp"] = 64 |
There was a problem hiding this comment.
define the smp size in cfg
There was a problem hiding this comment.
As a default config parameter in avocado, explicit definition will cause case name chaos in avocado list.
There was a problem hiding this comment.
I tried to define this parameter in the config file, whether attach to case name or in an independent variant field.
| process.system(f"taskset -pc 18 {pid}", ignore_status=True) | ||
| process.system("echo 0 > /sys/devices/system/cpu/cpu18/online") | ||
| session.cmd("init 0 &", ignore_all_errors=True) | ||
| process.system("sleep 3") |
|
Looks good to me. |
| session = vm.wait_for_login(timeout=timeout) | ||
| flags = params["guest_flags"] | ||
| check_cpu_flags(params, flags, test, session) | ||
| pid = process.getoutput("ps -edf | grep qemu | grep -E 'avocado-vt-vm.*' | grep -v grep | awk '{print $2}'") |
There was a problem hiding this comment.
There is API get_pid() in avocado-vt, please use it instead of shell command.
| check_cpu_flags(params, flags, test, session) | ||
| pid = process.getoutput("ps -edf | grep qemu | grep -E 'avocado-vt-vm.*' | grep -v grep | awk '{print $2}'") | ||
| process.system(f"taskset -pc 18 {pid}", ignore_status=True) | ||
| process.system("echo 0 > /sys/devices/system/cpu/cpu18/online") |
There was a problem hiding this comment.
There is API cpu.offline() in avocado, please use it.
And why choose cpu 18 as hardcode?
| seamcall_failed_match = seamcall_failed_pattern.search(dmesg.decode('utf-8')) | ||
| if hkid_str or crash_str or seamcall_failed_match: | ||
| test.fail(f"Detected the crash information in {i} time run. Fail!") | ||
| process.system("echo 1 > /sys/devices/system/cpu/cpu18/online") |
There was a problem hiding this comment.
Same comment as above, cpu.online()

It seems that cpu poweroff and vm down are concurrent processes so I run a subprocess on host to poweroff cpu.
lgtm.