From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dts] [PATCH v1] framework/qemu_kvm: check multiple times for network ready
Date: Wed, 10 Jan 2018 15:17:47 -0500 [thread overview]
Message-ID: <1515615467-56136-1-git-send-email-yong.liu@intel.com> (raw)
Control network start time will also be calculated into total startup
time. Will check multiple times for network status in case network not
ready in few sceonds.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index a75bf78..ec33669 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -1377,9 +1377,25 @@ class QEMUKvm(VirtBase):
wait for 120 seconds for vm net ready
10.0.2.* is the default ip address allocated by qemu
"""
- ret = self.control_command("network")
- # network has been ready, just return
- if ret == "Success":
+ cur_time = time.time()
+ time_diff = cur_time - self.start_time
+ try_times = 0
+ network_ready = False
+ while (time_diff < self.START_TIMEOUT):
+ if self.control_command("network") == "Success":
+ network_ready = True
+ break
+
+ # update time consume
+ cur_time = time.time()
+ time_diff = cur_time - self.start_time
+
+ self.host_logger.warning("[%s] on [%s] network not ready, retry %d times!!!" % (self.vm_name, self.host_dut.crb['My IP'], try_times + 1))
+ time.sleep(self.OPERATION_TIMEOUT)
+ try_times += 1
+ continue
+
+ if network_ready:
return True
else:
raise StartVMFailedException('Virtual machine control net not ready!!!')
--
1.9.3
reply other threads:[~2018-01-11 3:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1515615467-56136-1-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.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).