]> git.proxmox.com Git - mirror_qemu.git/commitdiff
scripts/device-crash-test: Use a QMP timeout
authorJohn Snow <jsnow@redhat.com>
Thu, 18 Nov 2021 20:46:19 +0000 (15:46 -0500)
committerJohn Snow <jsnow@redhat.com>
Mon, 22 Nov 2021 23:41:21 +0000 (18:41 -0500)
Despite all the previous fixes, it's still possible for
device-crash-test to wedge itself in the case that QEMU terminates *so
quickly* that it doesn't even begin a connection attempt to our QMP
client. Python will just joyfully wait ad infinitum for a connection
that will now never arrive.

The real fix is to use asyncio to simultaneously poll both the health of
the launched process AND the connection attempt. That's quite a bit more
invasive than just setting a connection timeout, though.

Do the very simplest thing for now.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20211118204620.1897674-7-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
scripts/device-crash-test

index 1c73dac93ee0299e00302b8be5d29442f04ea70e..7fbd99158be916bc174961cd600ed04baf12e783 100755 (executable)
@@ -353,7 +353,7 @@ def checkOneCase(args, testcase):
             '-device', qemuOptsEscape(device)]
     cmdline = ' '.join([binary] + args)
     dbg("will launch QEMU: %s", cmdline)
-    vm = QEMUMachine(binary=binary, args=args)
+    vm = QEMUMachine(binary=binary, args=args, qmp_timer=15)
 
     exc = None
     exc_traceback = None