1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
graphic: 0.914
x86: 0.864
performance: 0.782
device: 0.642
architecture: 0.580
socket: 0.576
ppc: 0.558
register: 0.538
semantic: 0.534
debug: 0.522
user-level: 0.504
PID: 0.449
virtual: 0.415
mistranslation: 0.379
vnc: 0.300
arm: 0.291
network: 0.285
risc-v: 0.281
TCG: 0.267
i386: 0.249
hypervisor: 0.245
assembly: 0.240
kernel: 0.201
VMM: 0.198
peripherals: 0.189
files: 0.147
permissions: 0.136
boot: 0.131
KVM: 0.073
regression in qtest clock_set/clock_step
Description of problem:
As of QEMU 9.0 the script included below would increment the time via qtest, but it is now broken and time doesn't seem to be updated. I do note that the QEMU sources use clock_step extensively via qtest_clock_step, but nothing seems to be using the return value so maybe that's why it hasn't been noticed?
It seems to have been broken in bc02be4508d8753d1f6071b77d10f4661587df6f which was trying to prevent some deadlock. You can prove that this breaks it by setting a breakpoint in `qemu_virtual_clock_set_ns` -- it never gets called.
Steps to reproduce:
Run this python script from your QEMU build directory:
```python
#!/usr/bin/env python3
import subprocess
import socket
import typing
qemu_path = "./qemu-system-x86_64"
def main():
s1, s2 = socket.socketpair()
qemu = subprocess.Popen(
[
qemu_path,
"-S",
"-display",
"none",
"-chardev", f"socket,id=qtest,fd={s1.fileno()},nodelay=on",
"-qtest", "chardev:qtest",
"-qtest-log", "/dev/fd/2",
"-accel", "qtest",
],
pass_fds=[s1.fileno()],
)
try:
fp = s2.makefile("rw", buffering=1)
fp.write(f"clock_set 1234\n")
result = fp.readline()[:-1].split(" ")
assert result == ["OK", "1234"], f"Unexpected result: {result}"
finally:
qemu.kill()
if __name__ == "__main__":
main()
```
|