scripts/kvm/kvm_stat: Read event values as u64

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 <frankja@linux.vnet.ibm.com>
Message-Id: <1452525484-32309-31-git-send-email-frankja@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Janosch Frank 2016-01-11 16:18:00 +01:00 committed by Paolo Bonzini
parent 00842aaca5
commit d8e44802f8

View File

@ -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))))