From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Alex Bennée" <alex.bennee@linaro.org>, "Fam Zheng" <famz@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, "Eduardo Habkost" <ehabkost@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH v3 4/8] tests/vm: Display remaining seconds to wait for a VM to start
Date: Sat, 13 Oct 2018 02:40:29 +0200 [thread overview]
Message-ID: <20181013004034.6968-5-f4bug@amsat.org> (raw)
In-Reply-To: <20181013004034.6968-1-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
tests/vm/basevm.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 9415e7c33a..81a1cb05dd 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -177,11 +177,14 @@ class BaseVM(object):
def wait_ssh(self, seconds=300):
starttime = datetime.datetime.now()
+ endtime = starttime + datetime.timedelta(seconds=seconds)
guest_up = False
- while (datetime.datetime.now() - starttime).total_seconds() < seconds:
+ while datetime.datetime.now() < endtime:
if self.ssh("exit 0") == 0:
guest_up = True
break
+ seconds = (endtime - datetime.datetime.now()).total_seconds()
+ logging.debug("%ds before timeout", seconds)
time.sleep(1)
if not guest_up:
raise Exception("Timeout while waiting for guest ssh")
--
2.19.1
next prev parent reply other threads:[~2018-10-13 0:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-13 0:40 [Qemu-devel] [PATCH v3 0/8] tests/vm: Improvements when KVM is not available Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 1/8] tests/vm: Extract the kvm_available() handy function Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 2/8] tests/vm: Do not abuse parallelism when KVM is not available Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 3/8] tests/vm: Do not use the -smp option with a single cpu Philippe Mathieu-Daudé
2018-10-13 0:40 ` Philippe Mathieu-Daudé [this message]
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 5/8] tests/vm: Add a BaseVM::arch property Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 6/8] tests/vm: Let kvm_available() work in cross environments Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 7/8] tests/vm: Do not use -enable-kvm if HOST != TARGET architecture Philippe Mathieu-Daudé
2018-10-13 0:40 ` [Qemu-devel] [PATCH v3 8/8] tests/vm: Do not abuse parallelism when " Philippe Mathieu-Daudé
2018-10-15 23:10 ` [Qemu-devel] [PATCH v3 0/8] tests/vm: Improvements when KVM is not available Richard Henderson
2018-10-22 21:10 ` Fam Zheng
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=20181013004034.6968-5-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alex.bennee@linaro.org \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=famz@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).