vmxcap: Open MSR file in unbuffered mode
Python may otherwise decide to to read larger chunks, applying the seek only on the software buffer. This will return results from the wrong MSRs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
This commit is contained in:
parent
1773d9ee6e
commit
f505a4d74a
@ -27,9 +27,9 @@ MSR_IA32_VMX_VMFUNC = 0x491
|
||||
class msr(object):
|
||||
def __init__(self):
|
||||
try:
|
||||
self.f = file('/dev/cpu/0/msr')
|
||||
self.f = open('/dev/cpu/0/msr', 'r', 0)
|
||||
except:
|
||||
self.f = file('/dev/msr0')
|
||||
self.f = open('/dev/msr0', 'r', 0)
|
||||
def read(self, index, default = None):
|
||||
import struct
|
||||
self.f.seek(index)
|
||||
|
Loading…
Reference in New Issue
Block a user