summaryrefslogtreecommitdiffstats
path: root/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch
blob: 016a6d2a2175834937daad3bb3d637f395fd3d60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
commit 00c37654013d216243383453de309a639f2599f3
Author: Jonas Eriksson <jonas.eriksson@enea.com>
Date:   Mon Apr 14 08:41:33 2014 +0200

    qemu_vm: Add monotonic start time

    For tests that would like to fetch the monotonic start time, expose it
    through the start_monotonic_time member.

    Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
    Upstream-Status: Backport

diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py
index 0a58362..6ed2736 100644
--- a/virttest/qemu_vm.py
+++ b/virttest/qemu_vm.py
@@ -150,6 +150,7 @@ class VM(virt_vm.BaseVM):
             self.instance = state['instance']
         self.qemu_command = ''
         self.start_time = 0.0
+        self.start_monotonic_time = 0.0
         self.last_boot_index = 0
         self.last_driver_index = 0
 
@@ -2169,6 +2170,7 @@ class VM(virt_vm.BaseVM):
             logging.info("Created qemu process with parent PID %d",
                          self.process.get_pid())
             self.start_time = time.time()
+            self.start_monotonic_time = utils_misc.monotonic_time()
 
             # test doesn't need to hold tapfd's open
             for nic in self.virtnet: