Skip to content

Commit

Permalink
qemu_vm.py: update vhost thread matching pattern and process command
Browse files Browse the repository at this point in the history
- updated the vhost_thread_pattern to match vhost thread names with
or without square brackets
- switched to using "ps -eL" for vhost thread detection, as vhost
threads are now created as separate threads and no longer appear in
"ps aux" output in the latest kernel. "ps -eL" also works with older
kernels.

Signed-off-by: Wenli Quan <[email protected]>
  • Loading branch information
quanwenli committed Sep 25, 2024
1 parent 9f11976 commit 8078b46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virttest/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3945,7 +3945,7 @@ def create(
", ".join([str(tid) for tid in self.vcpu_threads]),
)
vhost_thread_pattern = params.get(
"vhost_thread_pattern", r"\w+\s+(\d+)\s.*\[vhost-%s\]"
"vhost_thread_pattern", r"(\d+)\s+\d+\s.*vhost-%s"
)
self.vhost_threads = self.get_vhost_threads(vhost_thread_pattern)

Expand Down Expand Up @@ -4396,7 +4396,7 @@ def get_vhost_threads(self, vhost_thread_pattern):
int(_)
for _ in re.findall(
vhost_thread_pattern % self.get_pid(),
process.run("ps aux", verbose=False).stdout_text,
process.run("ps -eL", verbose=False).stdout_text,
)
]

Expand Down

0 comments on commit 8078b46

Please sign in to comment.