qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 30/34] scripts/kvm/kvm_stat: Read event values as


From: Janosch Frank
Subject: [Qemu-devel] [PATCH v2 30/34] scripts/kvm/kvm_stat: Read event values as u64
Date: Mon, 11 Jan 2016 16:18:00 +0100

The struct read_format, which denotes the returned values on a read
states that the values are u64 and not long long which is used for
struct unpacking.

Therefore the 'q' long long formatter was exchanged with 'Q' which is
the format for u64 data.

Signed-off-by: Janosch Frank <address@hidden>
---
 scripts/kvm/kvm_stat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index ea5bae8..e71fbef 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -358,7 +358,7 @@ class Group(object):
 
     def read(self):
         length = 8 * (1 + len(self.events))
-        read_format = 'xxxxxxxx' + 'q' * len(self.events)
+        read_format = 'xxxxxxxx' + 'Q' * len(self.events)
         return dict(zip([event.name for event in self.events],
                         struct.unpack(read_format,
                                       os.read(self.events[0].fd, length))))
-- 
2.3.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]