diff options
Diffstat (limited to 'recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch')
-rw-r--r-- | recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch new file mode 100644 index 0000000..016a6d2 --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | commit 00c37654013d216243383453de309a639f2599f3 | ||
2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
3 | Date: Mon Apr 14 08:41:33 2014 +0200 | ||
4 | |||
5 | qemu_vm: Add monotonic start time | ||
6 | |||
7 | For tests that would like to fetch the monotonic start time, expose it | ||
8 | through the start_monotonic_time member. | ||
9 | |||
10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
11 | Upstream-Status: Backport | ||
12 | |||
13 | diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py | ||
14 | index 0a58362..6ed2736 100644 | ||
15 | --- a/virttest/qemu_vm.py | ||
16 | +++ b/virttest/qemu_vm.py | ||
17 | @@ -150,6 +150,7 @@ class VM(virt_vm.BaseVM): | ||
18 | self.instance = state['instance'] | ||
19 | self.qemu_command = '' | ||
20 | self.start_time = 0.0 | ||
21 | + self.start_monotonic_time = 0.0 | ||
22 | self.last_boot_index = 0 | ||
23 | self.last_driver_index = 0 | ||
24 | |||
25 | @@ -2169,6 +2170,7 @@ class VM(virt_vm.BaseVM): | ||
26 | logging.info("Created qemu process with parent PID %d", | ||
27 | self.process.get_pid()) | ||
28 | self.start_time = time.time() | ||
29 | + self.start_monotonic_time = utils_misc.monotonic_time() | ||
30 | |||
31 | # test doesn't need to hold tapfd's open | ||
32 | for nic in self.virtnet: | ||