From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] scripts/qmp: Accept timeout parameter on accept()
Date: Tue, 13 Jun 2017 20:06:25 -0300 [thread overview]
Message-ID: <20170613230627.17942-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20170613230627.17942-1-ehabkost@redhat.com>
Shorter timeouts will be useful for test code that needs to catch QEMU
exiting before it connects to the QMP socket.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
scripts/qmp/qmp.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py
index 62d3651967..1b27064d91 100644
--- a/scripts/qmp/qmp.py
+++ b/scripts/qmp/qmp.py
@@ -132,7 +132,7 @@ class QEMUMonitorProtocol:
if negotiate:
return self.__negotiate_capabilities()
- def accept(self):
+ def accept(self, timeout=15):
"""
Await connection from QMP Monitor and perform capabilities negotiation.
@@ -141,7 +141,7 @@ class QEMUMonitorProtocol:
@raise QMPConnectError if the greeting is not received
@raise QMPCapabilitiesError if fails to negotiate capabilities
"""
- self.__sock.settimeout(15)
+ self.__sock.settimeout(timeout)
self.__sock, _ = self.__sock.accept()
self.__sockfile = self.__sock.makefile()
return self.__negotiate_capabilities()
--
2.11.0.259.g40922b1
next prev parent reply other threads:[~2017-06-13 23:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 23:06 [Qemu-devel] [PATCH 0/3] device-crash-test: New mode for testing -object Eduardo Habkost
2017-06-13 23:06 ` Eduardo Habkost [this message]
2017-06-13 23:06 ` [Qemu-devel] [PATCH 2/3] scripts/qemu: Catch QEMU exit while waiting for QMP client Eduardo Habkost
2017-06-13 23:06 ` [Qemu-devel] [PATCH 3/3] device-crash-test: Mode for testing -object Eduardo Habkost
2017-06-13 23:20 ` [Qemu-devel] [PATCH 0/3] device-crash-test: New mode " no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170613230627.17942-2-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).