summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/guest_pin_stream.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-23 21:32:31 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-23 21:32:31 -0400
commitd4cc5f989943f01875dea86b834d90538a748112 (patch)
treedd45f6cb5a91a747e19a72192e0a43f64001d3f6 /tools/guest-diag/guest_pin_stream.py
parent4f648aba4706af53e746e093ed8137771d947fe1 (diff)
downloadopen-iov-d4cc5f989943f01875dea86b834d90538a748112.tar.gz
open-iov-d4cc5f989943f01875dea86b834d90538a748112.zip
tools: transport-proof demand writes + tolerant demand parsing (the pool-pin latency root cause)
The r581 boot's guest scanner died mid-boot with ValueError in main(): "invalid literal for int() with base 16: '0x20400f000\\n0x121000000\\n0x12000ab4c'". A guest-agent transport-escaped append merged demand VAs onto one line with literal backslash-n, and the old parser crashed on it. The crash stopped ALL new pins; the host only re-asserted known pairs, so the UVM pool VA 0x121000000 never arrived while 185 other injections flowed - the pool-pin latency that blocked every validation boot. * pin_gr_stream._demand_send/_demand_loop now write one "echo <va> >>" per VA (no newlines, no backslashes in the transported command; immune to transport escaping). * guest_pin_stream's demand parser extracts every 0x token with re and skips malformed ones instead of raising out of main().
Diffstat (limited to 'tools/guest-diag/guest_pin_stream.py')
-rw-r--r--tools/guest-diag/guest_pin_stream.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/guest-diag/guest_pin_stream.py b/tools/guest-diag/guest_pin_stream.py
index aa21655..b56f79d 100644
--- a/tools/guest-diag/guest_pin_stream.py
+++ b/tools/guest-diag/guest_pin_stream.py
@@ -1772,8 +1772,21 @@ def main():
st_d = os.stat("/tmp/guest_want_vas.txt")
if st_d.st_mtime != _want_state.get("mtime"):
with open("/tmp/guest_want_vas.txt") as fw:
- wvas = [int(t, 16) for t in fw.read().split()
- if t.startswith("0x")]
+ # r582: tolerate malformed historical lines. The
+ # r581 boot's scanner died here: a transport-escaped
+ # append merged VAs into one token containing
+ # literal backslash-n ('0x20400f000\\n0x121000000\\n
+ # ...') and int(t, 16) raised ValueError out of
+ # main(), stopping ALL new pins (the observed
+ # pool-pin latency). Extract every 0x token instead;
+ # a bad token is skipped, never fatal.
+ wvas = []
+ for t in re.findall(r"0x[0-9a-fA-F]+",
+ fw.read()):
+ try:
+ wvas.append(int(t, 16))
+ except ValueError:
+ pass
_want_state["mtime"] = st_d.st_mtime
for wv in wvas[-64:]:
if wv in _want_state["done"]: